I am using Slider control to allow user modifying a value whose change will start update that takes several seconds.
All the value changed events that I've tried fire the event as soon as the value changes, and I haven't found a way to detect whether the Slider is still active (and thus likely changing the value again).
So I'd need solid way to catch when the sliding is done.
You could do what neil said with subclassing and overriding OnThumbDragComplete, but an easier solution might just be for you to stay attached to the ValueChanged event and, instead of doing your work right in that event handler, kick off a DispatcherTimer that waits half a second or whatever makes sense for you. If the timer is already kicked off, you cancel and reset it. When the timer finally ticks, you do the work you wanted to do.
'Cause if you think about it, people don't always drag the slider anyway. Lots of people click on the slider bar or the repeat buttons to advance it a couple of ticks at a time. You don't want to go off an do your expensive work in those cases either.
Thanks for the alternative suggestion; I had actually thought of that kind of solution. The problem in my case was, that as I update the descrption field that contains the sliding value, people may keep sliding and pause while still sliding when figuring out where they should stop.
Now in such a case unless I can detect the sliding active status, it's not clear what kind of time should be used.
This is not against your suggestion at all, but in this case it would become more of a guessing of "best working" time delay and the end result would be not working in fixed enough way for my taste for this solution.
I actually went around it somewhere in between; I removed the longer taking refresh action from the slider(s) (there are two of them changing different values) and added "Apply" button beside them.
The button's IsEnabled is bound to the boolean property (I'll call it IsButtonEnabled here) that simply compares the "current effective values" with the slider changing property values. If they differ, the button is active for user to click for refreshing.
Both the slider properties of course then send the PropertyChanged notification for the IsButtonEnabled helper property, when the sliders change their property values.