コード例 #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();
            });
        }
コード例 #2
0
 public void Connect(IGraphicsView graphicsView)
 {
     this.graphicsView = graphicsView;
     if (OperatingSystem.IsIOSVersionAtLeast(13))
     {
         AddGestureRecognizer(hoverGesture = new UIHoverGestureRecognizer(OnHover));
     }
 }
コード例 #3
0
 Task ValidateHasColor(IGraphicsView graphicsView, Color color, Action action = null)
 {
     return(InvokeOnMainThreadAsync(() =>
     {
         var PlatformGraphicsView = GetPlatformGraphicsView(CreateHandler(graphicsView));
         action?.Invoke();
         PlatformGraphicsView.AssertContainsColor(color);
     }));
 }
コード例 #4
0
 public void InitializeGraphics(IGraphicsView view, IInputWatcher input)
 {
     Configuration.GraphicsView = view;
     Configuration.InputWatcher = input;
 }
コード例 #5
0
 public static void UpdateDrawable(this W2DGraphicsView PlatformGraphicsView, IGraphicsView graphicsView)
 {
     PlatformGraphicsView.Drawable = graphicsView.Drawable;
 }
コード例 #6
0
 public void Connect(IGraphicsView graphicsView) => _graphicsView = graphicsView;
コード例 #7
0
 public void UpdateDrawable(IGraphicsView graphicsView)
 {
     _platformGraphicsView.UpdateDrawable(graphicsView);
     _graphicsView = graphicsView;
 }
コード例 #8
0
 public static void UpdateDrawable(this W2DGraphicsView nativeGraphicsView, IGraphicsView graphicsView)
 {
     nativeGraphicsView.Drawable = graphicsView.Drawable;
 }
コード例 #9
0
 public static void UpdateDrawable(this SkiaGraphicsView platformGraphicsView, IGraphicsView graphicsView)
 {
     platformGraphicsView.Drawable = graphicsView.Drawable;
 }
コード例 #10
0
 public void Connect(IGraphicsView graphicsView)
 {
     this.graphicsView = graphicsView;
     AddGestureRecognizer(hoverGesture = new UIHoverGestureRecognizer(OnHover));
 }