Beispiel #1
0
        public void Connect(IGraphicsView graphicsView)
        {
            _graphicsView = graphicsView;
            _gestureLayer = new GestureLayer(this);
            _gestureLayer.Attach(this);

            _gestureLayer.SetTapCallback(GestureLayer.GestureType.Tap, GestureLayer.GestureState.Start, (_) => { OnGestureStarted(); });

            _gestureLayer.SetTapCallback(GestureLayer.GestureType.Tap, GestureLayer.GestureState.End, (_) => { OnGestureEnded(true); });

            _gestureLayer.SetLineCallback(GestureLayer.GestureState.Start, (_) => { OnGestureStarted(); });

            _gestureLayer.SetLineCallback(GestureLayer.GestureState.Move, (_) =>
            {
                _graphicsView?.DragInteraction(new[] { _gestureLayer.EvasCanvas.Pointer.ToPointF() });
            });

            _gestureLayer.SetLineCallback(GestureLayer.GestureState.End, (_) =>
            {
                OnGestureEnded(Geometry.ToDP().Contains(_gestureLayer.EvasCanvas.Pointer.ToPoint()));
            });

            _gestureLayer.SetLineCallback(GestureLayer.GestureState.Abort, (_) =>
            {
                _graphicsView?.CancelInteraction();
            });
        }
 public void Connect(IGraphicsView graphicsView)
 {
     this.graphicsView = graphicsView;
     if (OperatingSystem.IsIOSVersionAtLeast(13))
     {
         AddGestureRecognizer(hoverGesture = new UIHoverGestureRecognizer(OnHover));
     }
 }
Beispiel #3
0
 Task ValidateHasColor(IGraphicsView graphicsView, Color color, Action action = null)
 {
     return(InvokeOnMainThreadAsync(() =>
     {
         var PlatformGraphicsView = GetPlatformGraphicsView(CreateHandler(graphicsView));
         action?.Invoke();
         PlatformGraphicsView.AssertContainsColor(color);
     }));
 }
Beispiel #4
0
 public void InitializeGraphics(IGraphicsView view, IInputWatcher input)
 {
     Configuration.GraphicsView = view;
     Configuration.InputWatcher = input;
 }
Beispiel #5
0
 public static void UpdateDrawable(this W2DGraphicsView PlatformGraphicsView, IGraphicsView graphicsView)
 {
     PlatformGraphicsView.Drawable = graphicsView.Drawable;
 }
Beispiel #6
0
 public void Connect(IGraphicsView graphicsView) => _graphicsView = graphicsView;
 public void UpdateDrawable(IGraphicsView graphicsView)
 {
     _platformGraphicsView.UpdateDrawable(graphicsView);
     _graphicsView = graphicsView;
 }
 public static void UpdateDrawable(this W2DGraphicsView nativeGraphicsView, IGraphicsView graphicsView)
 {
     nativeGraphicsView.Drawable = graphicsView.Drawable;
 }
Beispiel #9
0
 public static void UpdateDrawable(this SkiaGraphicsView platformGraphicsView, IGraphicsView graphicsView)
 {
     platformGraphicsView.Drawable = graphicsView.Drawable;
 }
Beispiel #10
0
 public void Connect(IGraphicsView graphicsView)
 {
     this.graphicsView = graphicsView;
     AddGestureRecognizer(hoverGesture = new UIHoverGestureRecognizer(OnHover));
 }