Пример #1
0
 public static void ReleasePointerCapture(this IInputElement element, IPointer device)
 {
     if (element == device.Captured)
     {
         device.Capture(null);
     }
 }
Пример #2
0
        public void Begin(IPointer pointer, Point point)
        {
            pointer.Capture(element);
            var tone = vm.NotesViewModel.PointToTone(point);

            sineGen = PlaybackManager.Inst.PlayTone(MusicMath.ToneToFreq(tone));
        }
Пример #3
0
 public void End(IPointer pointer, Point point)
 {
     pointer.Capture(null);
     if (sineGen != null)
     {
         sineGen.Stop = true;
     }
 }
Пример #4
0
 void IGestureRecognizerActionsDispatcher.Capture(IPointer pointer, IGestureRecognizer recognizer)
 {
     pointer.Capture(_inputElement);
     _pointerGrabs[pointer] = recognizer;
     foreach (var r in _recognizers)
     {
         if (r != recognizer)
         {
             r.PointerCaptureLost(pointer);
         }
     }
 }
Пример #5
0
        public void Capture_Is_Transferred_To_Parent_When_Control_Removed()
        {
            using var app = UnitTestApplication.Start(new TestServices(inputManager: new InputManager()));

            var renderer = new Mock <IRenderer>();
            var device   = new MouseDevice();
            var impl     = CreateTopLevelImplMock(renderer.Object);

            Canvas control;
            Panel  rootChild;
            var    root = CreateInputRoot(impl.Object, rootChild = new Panel
            {
                Children =
                {
                    (control = new Canvas())
                }
            });

            // Synthesize event to receive a pointer.
            IPointer result = null;

            root.PointerMoved += (_, a) =>
            {
                result = a.Pointer;
            };
            SetHit(renderer, control);
            impl.Object.Input !(CreateRawPointerMovedArgs(device, root));

            Assert.NotNull(result);

            result.Capture(control);
            Assert.Same(control, result.Captured);

            rootChild.Children.Clear();

            Assert.Same(rootChild, result.Captured);
        }
Пример #6
0
 void IGestureRecognizerActionsDispatcher.Capture(IPointer pointer, IGestureRecognizer recognizer)
 {
     pointer.Capture(_inputElement);
     _pointerGrabs[pointer] = recognizer;
 }
Пример #7
0
 public static bool CapturePointer(this IInputElement element, IPointer device)
 {
     device.Capture(element);
     return(device.Captured == element);
 }
Пример #8
0
 public virtual void End(IPointer pointer, Point point)
 {
     pointer.Capture(null);
     DocManager.Inst.EndUndoGroup();
 }
Пример #9
0
 public virtual void Begin(IPointer pointer, Point point)
 {
     pointer.Capture(canvas);
     startPoint = point;
     DocManager.Inst.StartUndoGroup();
 }
Пример #10
0
 public override void End(IPointer pointer, Point point)
 {
     pointer.Capture(null);
 }
Пример #11
0
 public override void Begin(IPointer pointer, Point point)
 {
     pointer.Capture(canvas);
     startPoint = point;
 }