public static void ReleasePointerCapture(this IInputElement element, IPointer device) { if (element == device.Captured) { device.Capture(null); } }
public void Begin(IPointer pointer, Point point) { pointer.Capture(element); var tone = vm.NotesViewModel.PointToTone(point); sineGen = PlaybackManager.Inst.PlayTone(MusicMath.ToneToFreq(tone)); }
public void End(IPointer pointer, Point point) { pointer.Capture(null); if (sineGen != null) { sineGen.Stop = true; } }
void IGestureRecognizerActionsDispatcher.Capture(IPointer pointer, IGestureRecognizer recognizer) { pointer.Capture(_inputElement); _pointerGrabs[pointer] = recognizer; foreach (var r in _recognizers) { if (r != recognizer) { r.PointerCaptureLost(pointer); } } }
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); }
void IGestureRecognizerActionsDispatcher.Capture(IPointer pointer, IGestureRecognizer recognizer) { pointer.Capture(_inputElement); _pointerGrabs[pointer] = recognizer; }
public static bool CapturePointer(this IInputElement element, IPointer device) { device.Capture(element); return(device.Captured == element); }
public virtual void End(IPointer pointer, Point point) { pointer.Capture(null); DocManager.Inst.EndUndoGroup(); }
public virtual void Begin(IPointer pointer, Point point) { pointer.Capture(canvas); startPoint = point; DocManager.Inst.StartUndoGroup(); }
public override void End(IPointer pointer, Point point) { pointer.Capture(null); }
public override void Begin(IPointer pointer, Point point) { pointer.Capture(canvas); startPoint = point; }