public void AddGesture(object sender, RoutedEventArgs e) { if (_captureGestureCancellationSource?.IsCancellationRequested == false) { _captureGestureCancellationSource?.Cancel(); } if (CapturedGesture == null) { return; } _manager.RegisterGesture(CapturedGesture); SelectedBinding = KeyValuePair.Create(CapturedGesture, Bindings[CapturedGesture]); CapturedGesture = null; }