Пример #1
0
 public void NotesCanvasPointerWheelChanged(object sender, PointerWheelEventArgs args)
 {
     lyricBox?.EndEdit();
     if (args.KeyModifiers == KeyModifiers.None)
     {
         var scrollbar = this.FindControl <ScrollBar>("VScrollBar");
         VScrollPointerWheelChanged(scrollbar, args);
     }
     else if (args.KeyModifiers == KeyModifiers.Alt)
     {
         var canvas   = (Canvas)sender;
         var position = args.GetCurrentPoint((IVisual)sender).Position;
         var size     = canvas.Bounds.Size;
         position = position.WithX(position.X / size.Width).WithY(position.Y / size.Height);
         ViewModel.NotesViewModel.OnYZoomed(position, 0.1 * args.Delta.Y);
     }
     else if (args.KeyModifiers == KeyModifiers.Shift)
     {
         var scrollbar = this.FindControl <ScrollBar>("HScrollBar");
         HScrollPointerWheelChanged(scrollbar, args);
     }
     else if (args.KeyModifiers == KeyModifiers.Control)
     {
         var canvas = this.FindControl <Canvas>("TimelineCanvas");
         TimelinePointerWheelChanged(canvas, args);
     }
 }
Пример #2
0
        public void TimelinePointerWheelChanged(object sender, PointerWheelEventArgs args)
        {
            var canvas   = (Canvas)sender;
            var position = args.GetCurrentPoint((IVisual)sender).Position;
            var size     = canvas.Bounds.Size;

            position = position.WithX(position.X / size.Width).WithY(position.Y / size.Height);
            viewModel.TracksViewModel.OnXZoomed(position, 0.1 * args.Delta.Y);
        }
Пример #3
0
        /// <inheritdoc />
        protected override void OnPointerWheelChanged(PointerWheelEventArgs e)
        {
            base.OnPointerWheelChanged(e);
            if (e.Handled)
            {
                return;
            }

            PointerPoint point = e.GetCurrentPoint(this);

            if (HandlePointerEvent(point, e.Delta))
            {
                e.Handled = true;
            }
        }