-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change Slider value on MouseWheel event. #2171
Change Slider value on MouseWheel event. #2171
Conversation
Possibility to rotate the mouse wheel and change the value of the slider in following situations: * None * Only when the slider is focuesed and the mouse wheel is rotated * If the mouse pointer is over the slider and the mouse wheel is rotated
{ | ||
UnregisterEvents(slider); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should always unregister the events
if (e.NewValue != e.OldValue)
{
var slider = (Slider)d;
UnregisterEvents(slider);
if ((MouseWheelState)e.NewValue != MouseWheelState.None)
{
slider.Unloaded += OnUnloaded;
slider.PreviewMouseWheel += OnPreviewMouseWheel;
}
}
BTW, I would introduce |
@thoemmi 👍 |
Changed OnX and GetX to parameter Slider instead of UIElement to recieve a warning in XAML designer.
Change Slider value on MouseWheel event.
Is there any change completion event for this mousewheel change of the slider value? |
Possibility to rotate the mouse wheel and change the value of the slider in following situations:
* None
* Only when the slider is focuesed and the mouse wheel is rotated
* If the mouse pointer is over the slider and the mouse wheel is rotated