Пример #1
0
        protected override void OnMouseWheel(MouseWheelEvent e)
        {
            int speed = MathHelper.Clamp(CurrentSpeed + e.Delta, 0, MaxSpeed);

            SpeedSelected.Raise(speed);
            e.Handled = true;
        }
Пример #2
0
        protected override void OnMouseButtonDown(MouseButtonEvent e)
        {
            var p = MapFromScreen(e.Position);
            int x = 0;

            for (int i = 0; i < 4; i++)
            {
                x += images[i, 0].Width;
                if (p.X < x)
                {
                    SpeedSelected.Raise(i);
                    break;
                }
            }
            e.Handled = true;
        }