/// <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
        public Slider()
        {
            Id = "Slider";

            Handles.Do(x => x.Css.Size(0)); // Without this the sizing goes wrong.

            ActiveHandle = Handle;

            Tapped.Handle(UserTapped);
            PanFinished.Handle(() => UserTapped(LastPanEnd));
            Panning.Handle(OnPanning);
        }
Beispiel #3
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;
            }
        }
Beispiel #4
0
 public InteractiveCanvas()
 {
     Panning.Handle(OnPanning);
     Pinching.Handle(OnPinched);
     UserRotating.Handle(UserRotated);
 }