Recently want to determine the Slider is a mouse click and change the value, or the program internal code changes the value of the mouse to find various events such as MouseDown, MouseUp, MouseLeftButtonDown What, there is no response, is helpless ...
Searching for some of the controls in WPF will give some events to Handled themselves, resulting in the addition of events between US invalid ...
However, you can add an event to a child element by calling the AddHandler method on the parent element.
This method has two overloads, and the main thing here is to use this overloaded parameter:
Public void AddHandler ( RoutedEvent RoutedEvent, Delegate handler, bool handledEventsToo)
The first is the type of event to be processed, the second is the event-handling method, and the third parameter is critical, because the event is called one-by-one, and it is likely that the Handled property is set to true to indicate that the event no longer needs to be handled by another processing method, but when this argument is passed to true , the event handling method bound here will no longer be restricted by the Handled attribute, and can still be called, so the rest is what to do.
msdn:https://msdn.microsoft.com/zh-cn/library/ms598899 (v=vs.100). aspx
A small pit of WPF control events ...