protected override void OnLoading() { base.OnLoading(); var element = Controller.Element; if (Orientation == Orientation.Vertical) { _scrollMode = MouseWheel.GetVScrollMode(element); _smoothing = MouseWheel.GetVScrollSmoothing(element); _modifiers = MouseWheel.GetVScrollModifiers(element); MouseWheel.VScrollModeProperty.AddValueChanged(element, OnVScrollModeChanged); MouseWheel.VScrollSmoothingProperty.AddValueChanged(element, OnVSmoothingChanged); MouseWheel.VScrollModifiersProperty.AddValueChanged(element, OnVModifiersChanged); MouseWheel.GetLogicalVScrollIncrement(element).SetOrientation(Orientation.Vertical); MouseWheel.GetPhysicalVScrollIncrement(element).SetOrientation(Orientation.Vertical); } else { _scrollMode = MouseWheel.GetHScrollMode(element); _smoothing = MouseWheel.GetHScrollSmoothing(element); _modifiers = MouseWheel.GetHScrollModifiers(element); MouseWheel.HScrollModeProperty.AddValueChanged(element, OnHScrollModeChanged); MouseWheel.HScrollSmoothingProperty.AddValueChanged(element, OnHSmoothingChanged); MouseWheel.HScrollModifiersProperty.AddValueChanged(element, OnHModifiersChanged); MouseWheel.GetLogicalHScrollIncrement(element).SetOrientation(Orientation.Horizontal); MouseWheel.GetPhysicalHScrollIncrement(element).SetOrientation(Orientation.Horizontal); } }
protected override void OnLoading() { base.OnLoading(); var element = Controller.Element; _modifiersKeys = MouseWheel.GetVScrollModifiers(element); MouseWheel.VScrollModifiersProperty.AddValueChanged(element, OnModifierKeysYChanged); }
private void OnModifierKeysYChanged(object sender, EventArgs e) { _modifiersKeys = MouseWheel.GetVScrollModifiers(sender as DependencyObject); }