Exemplo n.º 1
0
        public MouseWheelPhysicalScrollBehavior(MouseWheelScrollClient scrollClient, IDisposable manipulator)
            : base(scrollClient, manipulator)
        {
            var element = Client.Controller.Element;

            if (scrollClient.Orientation == Orientation.Vertical)
            {
                Debouncing      = MouseWheel.GetPhysicalVScrollDebouncing(element);
                ScrollIncrement = MouseWheel.GetPhysicalVScrollIncrement(element);
                MouseWheel.PhysicalVScrollDebouncingProperty.AddValueChanged(element, OnDebouncingYChanged);
                MouseWheel.PhysicalVScrollIncrementProperty.AddValueChanged(element, OnVScrollIncrementChanged);
            }
            else
            {
                Debouncing      = MouseWheel.GetPhysicalHScrollDebouncing(element);
                ScrollIncrement = MouseWheel.GetPhysicalHScrollIncrement(element);
                MouseWheel.PhysicalHScrollDebouncingProperty.AddValueChanged(element, OnDebouncingXChanged);
                MouseWheel.PhysicalHScrollIncrementProperty.AddValueChanged(element, OnHScrollIncrementChanged);
            }
        }
Exemplo n.º 2
0
 private void    OnDebouncingXChanged(object sender, EventArgs e)
 {
     Debouncing = MouseWheel.GetPhysicalHScrollDebouncing(sender as DependencyObject);
 }