/// <summary>
 /// Invoke the panning event.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The pan event.</param>
 internal void InvokePanning(View sender, PanEvent e)
 {
     Panning?.Invoke(sender, new PanEventArgs(e));
     if (e.State == GestureState.Ended && Command is ICommand cmd && cmd.CanExecute(CommandParameter))
     {
         cmd.Execute(CommandParameter);
     }
 }
Beispiel #2
0
        protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e)
        {
            base.OnPropertyChanged(e);

            switch (e.Property.Name)
            {
            case "Scale":
                Zooming?.Invoke(this, new ZoomEventArgs()
                {
                    OldScale = (double)e.OldValue,
                    NewScale = (double)e.NewValue
                });
                break;

            case "OffsetX":
            case "OffsetY":
                Panning?.Invoke(this, EventArgs.Empty);
                break;
            }
        }