I am making a music player in which I need to create a seek. Now I have done it in WinForms with a TrackBar in this way:
Scroll
event to change the media position when the user drags the TrackBar's thumb.But in WPF, there is no Scroll
event and the ValueChanged
event fires even when the value is changed in code. So, when I use a DispatcherTimer
to update the slider position, even then the ValueChanged
event is fired which in turn changes the media position. As a result, the media doesn't play properly.
So I need an Event which fires only when the value of a Slider
is changed by the user.
I have already come across this question but it doesn't have a proper answer.
Any help will be appreciated. Thanks in anticipation.
In your ValueChanged
event-handler, check for some properties to see for user interaction.
IsFocused, IsMouseDirectlyOver, IsMouseOver, IsKeyboardFocused, IsKeyboardFocusWithin
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With