Exemplo n.º 1
0
        public override bool CanMove(IMotionInfo info, object context)
        {
            var element = Controller.Element;
            var value   = MouseWheel.GetValue(element);

            return(info.Direction <0 ? value> _minimum : value < _maximum);
        }
Exemplo n.º 2
0
        public override double Coerce(IMotionInfo info, object context, double delta)
        {
            var element   = Controller.Element;
            var value     = MouseWheel.GetValue(element);
            int direction = info.Direction;

            if (direction > 0)
            {
                var movableDelta = _maximum - value;
                return(Math.Min(movableDelta, delta));
            }
            else
            {
                var movableDelta = _minimum - value;
                return(Math.Max(movableDelta, delta));
            }
        }
Exemplo n.º 3
0
        public override void Move(IMotionInfo info, object context, double delta)
        {
            var element = Controller.Element;

            MouseWheel.SetValue(element, MouseWheel.GetValue(element) + delta);
        }