Skip to content

Conversation

@michaelmairegger
Copy link
Contributor

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

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
Copy link
Member

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;
    }
}

@thoemmi
Copy link
Collaborator

thoemmi commented Oct 22, 2015

BTW, I would introduce RegisterEvents(Slider slider). Though it would be called only from one location, you would get symmetric methods, RegisterEvents and UnregisterEvents.

@punker76
Copy link
Member

@thoemmi 👍

Changed OnX and GetX to parameter Slider instead of UIElement to recieve a warning in XAML designer.
@michaelmairegger
Copy link
Contributor Author

@thoemmi @punker76 Done 👍

@punker76 punker76 added this to the 1.2.0 milestone Oct 22, 2015
punker76 added a commit that referenced this pull request Oct 22, 2015
Change Slider value on MouseWheel event.
@punker76 punker76 merged commit f7974fa into MahApps:master Oct 22, 2015
punker76 added a commit that referenced this pull request Oct 22, 2015
@michaelmairegger michaelmairegger deleted the feature/SliderExtensions branch October 23, 2015 06:49
@khteh
Copy link

khteh commented Oct 23, 2016

Is there any change completion event for this mousewheel change of the slider value?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants