✅ how do i check when a slider is being dragged?
everything i've already tried either doesn't work or has some bug with it :zena_sad:
5 Replies
i got something that almost works but it's not quite what i'd like. im currently using slider.pointerpressed but there are problems with that, it's checking if the slider is being pressed and not the thumb. which causes a couple issues. no major ones but It's still not what i'd like
basically, i think i need to access the thumbs events somehow but i have no idea how
https://learn.microsoft.com/en-us/dotnet/api/system.windows.controls.primitives.thumb.dragstarted
https://learn.microsoft.com/en-us/dotnet/api/system.windows.controls.primitives.thumb.dragdelta
https://learn.microsoft.com/en-us/dotnet/api/system.windows.controls.primitives.thumb.dragcompleted
You can use these three events and probably also need to handle
ValueChanged
event to cover all your baseshow would i access the thumb on the slider though? im still pretty new to xaml and avalonia, this is one of things that's been tripping me up pretty frequently.
@ـّّّ Jordan't ـّّّ I don't have access to a windows machine right now, so can't test WPF, but I think you can use this event
https://learn.microsoft.com/en-us/dotnet/api/system.windows.controls.slider.onthumbdragdelta
Slider.OnThumbDragDelta(DragDeltaEventArgs) Method (System.Windows....
Provides class handling for the DragDelta event that occurs when the user drags the Thumb of the Slider.
i don't seem to have access to that event. it's probably just an avalonia thing.
well, i think i've found a solution now. kind of a band-aid fix but it works. still a bit curious to know if i can access that thumb though :UnityChanThink: