private void InkPresenter_StrokesErased(InkPresenter sender, InkStrokesErasedEventArgs args) { ClearSelection(); inkCanvas.InkPresenter.UnprocessedInput.PointerPressed -= UnprocessedInput_PointerPressed; inkCanvas.InkPresenter.UnprocessedInput.PointerMoved -= UnprocessedInput_PointerMoved; inkCanvas.InkPresenter.UnprocessedInput.PointerReleased -= UnprocessedInput_PointerReleased; }
public InkCanvasPage() { this.InitializeComponent(); _inkPresenter = Control1.InkPresenter; _inkPresenter.InputDeviceTypes = CoreInputDeviceTypes.Mouse | CoreInputDeviceTypes.Pen | CoreInputDeviceTypes.Touch; UpdatePen(); }
private void InkPresenter_StrokesErased(InkPresenter sender, InkStrokesErasedEventArgs args) { pointerTimer.Stop(); recognitionTimer.Start(); }
public InkPresenterEvents(InkPresenter This) { this.This = This; }
public static IObservable <EventPattern <KeyboardFocusChangedEventArgs> > LostKeyboardFocusObserver(this InkPresenter This) { return(Observable.FromEventPattern <KeyboardFocusChangedEventHandler, KeyboardFocusChangedEventArgs>(h => This.LostKeyboardFocus += h, h => This.LostKeyboardFocus -= h)); }
public InkControl() { // Add an InkPresenter for drawing. ip = new InkPresenter(); this.Content = ip; }
private void InkPresenter_StrokesCollected(InkPresenter sender, InkStrokesCollectedEventArgs args) { SendInk(); }
async void OnStrokesCollected( InkPresenter sender, InkStrokesCollectedEventArgs args) { // create the ink recognizer if we haven't done already. if (this.inkRecognizer == null) { this.inkRecognizer = new InkRecognizerContainer(); } // recognise the ink which has not already been recognised // (i.e. do incremental ink recognition). var results = await this.inkRecognizer.RecognizeAsync( sender.StrokeContainer, InkRecognitionTarget.Recent); // update the container so that it knows next time that this // ink is already recognised. sender.StrokeContainer.UpdateRecognitionResults(results); // we take all the top results that the recogniser gives us // back. var newTags = results.Select( result => result.GetTextCandidates().FirstOrDefault()); // add the new tags to our photo. await this.photoControl.AddTagsToPhotoAsync(this.currentPhotoId, newTags); }
public static IObservable <EventPattern <MouseButtonEventArgs> > PreviewMouseRightButtonDownObserver(this InkPresenter This) { return(Observable.FromEventPattern <MouseButtonEventHandler, MouseButtonEventArgs>(h => This.PreviewMouseRightButtonDown += h, h => This.PreviewMouseRightButtonDown -= h)); }
/* Event Handlers */ private void InkPresenter_StrokesCollected(InkPresenter sender, InkStrokesCollectedEventArgs args) { RecogniseText(); }
private void InkPresenter_StrokesCollected(InkPresenter sender, InkStrokesCollectedEventArgs args) { _timer.Start(); }
private void InkPresenter_StrokesErased(InkPresenter sender, InkStrokesErasedEventArgs args) { ClearSelection(); }
/// <summary>Initializes a new instance of the <see cref="T:System.Windows.Automation.Peers.InkPresenterAutomationPeer" /> class.</summary> /// <param name="owner">The <see cref="T:System.Windows.Controls.InkPresenter" /> that is associated with this <see cref="T:System.Windows.Automation.Peers.InkPresenterAutomationPeer" />.</param> // Token: 0x060026FF RID: 9983 RVA: 0x000B2FD9 File Offset: 0x000B11D9 public InkPresenterAutomationPeer(InkPresenter owner) : base(owner) { }
private void InkPresenter_StrokesErased(InkPresenter sender, InkStrokesErasedEventArgs args) { rootPage.NotifyUser(args.Strokes.Count + " strokes erased!", SDKTemplate.NotifyType.StatusMessage); }
private void InkPresenter_StrokesCollected(InkPresenter sender, InkStrokesCollectedEventArgs args) { saved = false; }
private async void InkPresenter_StrokesCollected(InkPresenter sender, InkStrokesCollectedEventArgs args) { // Notify user about the risk when using inking for the first time. if ((bool)App.AppSettings[App.INKING_WARNING]) { int userResponse = await App.NotifyUserWithOptions(Messages.INK_STROKE_WARNING, new string[] { "OK, do not show this again.", "Notify me again next time." }); switch (userResponse) { case 0: // Do not show again ApplicationData.Current.RoamingSettings.Values[App.INKING_WARNING] = false; App.AppSettings[App.INKING_WARNING] = false; break; default: App.AppSettings[App.INKING_WARNING] = false; break; } } int p = findPageNumberByInkPresenter(sender); await inkManager.addStrokes(p, sender.StrokeContainer, args.Strokes); }
public static IObservable <EventPattern <MouseButtonEventArgs> > MouseRightButtonUpObserver(this InkPresenter This) { return(Observable.FromEventPattern <MouseButtonEventHandler, MouseButtonEventArgs>(h => This.MouseRightButtonUp += h, h => This.MouseRightButtonUp -= h)); }
private void InkPresenter_StrokesCollected(InkPresenter sender, InkStrokesCollectedEventArgs args) { strokeList.AddRange(args.Strokes); foreach (var s in args.Strokes) { inkManager.AddStroke(s); } canvasControl.Invalidate(); }
public static IObservable <EventPattern <MouseWheelEventArgs> > PreviewMouseWheelObserver(this InkPresenter This) { return(Observable.FromEventPattern <MouseWheelEventHandler, MouseWheelEventArgs>(h => This.PreviewMouseWheel += h, h => This.PreviewMouseWheel -= h)); }
private void InkPresenter_StrokesCollected(InkPresenter sender, InkStrokesCollectedEventArgs args) { rootPage.NotifyUser(args.Strokes.Count + " stroke(s) collected!", NotifyType.StatusMessage); }
public static IObservable <EventPattern <MouseEventArgs> > MouseEnterObserver(this InkPresenter This) { return(Observable.FromEventPattern <MouseEventHandler, MouseEventArgs>(h => This.MouseEnter += h, h => This.MouseEnter -= h)); }
private void InkPresenter_StrokesErased(InkPresenter sender, InkStrokesErasedEventArgs args) { var removed = args.Strokes; var strokeList = inkManager.GetStrokes().Except(removed).ToList(); inkManager = new InkManager(); strokeList.ForEach(inkManager.AddStroke); ClearSelection(); canvasControl.Invalidate(); }
public static IObservable <EventPattern <MouseEventArgs> > GotMouseCaptureObserver(this InkPresenter This) { return(Observable.FromEventPattern <MouseEventHandler, MouseEventArgs>(h => This.GotMouseCapture += h, h => This.GotMouseCapture -= h)); }
public static IObservable <EventPattern <SizeChangedEventArgs> > SizeChangedObserver(this InkPresenter This) { return(Observable.FromEventPattern <SizeChangedEventHandler, SizeChangedEventArgs>(h => This.SizeChanged += h, h => This.SizeChanged -= h)); }
public static IObservable <EventPattern <DataTransferEventArgs> > SourceUpdatedObserver(this InkPresenter This) { return(Observable.FromEventPattern <EventHandler <DataTransferEventArgs>, DataTransferEventArgs>(h => This.SourceUpdated += h, h => This.SourceUpdated -= h)); }
public static IObservable <EventPattern <TextCompositionEventArgs> > TextInputObserver(this InkPresenter This) { return(Observable.FromEventPattern <TextCompositionEventHandler, TextCompositionEventArgs>(h => This.TextInput += h, h => This.TextInput -= h)); }
public static IObservable <EventPattern <QueryCursorEventArgs> > QueryCursorObserver(this InkPresenter This) { return(Observable.FromEventPattern <QueryCursorEventHandler, QueryCursorEventArgs>(h => This.QueryCursor += h, h => This.QueryCursor -= h)); }
private void InkPresenter_StrokesCollected(InkPresenter sender, InkStrokesCollectedEventArgs args) { timer.Start(); }
public static IObservable <EventPattern <StylusEventArgs> > PreviewStylusInAirMoveObserver(this InkPresenter This) { return(Observable.FromEventPattern <StylusEventHandler, StylusEventArgs>(h => This.PreviewStylusInAirMove += h, h => This.PreviewStylusInAirMove -= h)); }
/// <summary> /// Start countdown timer once the user has finished inking /// </summary> /// <param name="sender"></param> /// <param name="args"></param> private void InkCanvas_StrokesCollected(InkPresenter sender, InkStrokesCollectedEventArgs args) { pointerTimer.Stop(); recognitionTimer.Start(); }
public static IObservable <EventPattern <DependencyPropertyChangedEventArgs> > DataContextChangedObserver(this InkPresenter This) { return(Observable.FromEventPattern <DependencyPropertyChangedEventHandler, DependencyPropertyChangedEventArgs>(h => This.DataContextChanged += h, h => This.DataContextChanged -= h)); }
private async void InkPresenter_StrokesErased(InkPresenter sender, InkStrokesErasedEventArgs args) { int p = findPageNumberByInkPresenter(sender); await inkManager.eraseStrokes(p, sender.StrokeContainer, args.Strokes); }
public static IObservable <EventPattern <StylusEventArgs> > StylusOutOfRangeObserver(this InkPresenter This) { return(Observable.FromEventPattern <StylusEventHandler, StylusEventArgs>(h => This.StylusOutOfRange += h, h => This.StylusOutOfRange -= h)); }
private int findPageNumberByInkPresenter(InkPresenter sender) { // Find the page number int pageNumber = 0; foreach (int i in inkCanvasList) { InkCanvas inkCanvas = (InkCanvas)this.imagePanel.FindName(PREFIX_CANVAS + i.ToString()); if (inkCanvas.InkPresenter == sender) { pageNumber = i; break; } } if (pageNumber == 0) { AppEventSource.Log.Error("ViewerPage: Strokes Changed but Ink canvas not found."); } return pageNumber; }
public static IObservable <EventPattern <StylusSystemGestureEventArgs> > StylusSystemGestureObserver(this InkPresenter This) { return(Observable.FromEventPattern <StylusSystemGestureEventHandler, StylusSystemGestureEventArgs>(h => This.StylusSystemGesture += h, h => This.StylusSystemGesture -= h)); }
private void InkPresenter_StrokesErased(InkPresenter sender, InkStrokesErasedEventArgs args) { var removed = args.Strokes; foreach (var s in removed) { strokeList.Remove(s); } inkManager = new InkManager(); foreach (var s in strokeList) { inkManager.AddStroke(s); } ClearSelection(); canvasControl.Invalidate(); }
public static IObservable <EventPattern <StylusEventArgs> > LostStylusCaptureObserver(this InkPresenter This) { return(Observable.FromEventPattern <StylusEventHandler, StylusEventArgs>(h => This.LostStylusCapture += h, h => This.LostStylusCapture -= h)); }
public static IObservable <EventPattern <StylusButtonEventArgs> > StylusButtonDownObserver(this InkPresenter This) { return(Observable.FromEventPattern <StylusButtonEventHandler, StylusButtonEventArgs>(h => This.StylusButtonDown += h, h => This.StylusButtonDown -= h)); }
public static IObservable <EventPattern <RequestBringIntoViewEventArgs> > RequestBringIntoViewObserver(this InkPresenter This) { return(Observable.FromEventPattern <RequestBringIntoViewEventHandler, RequestBringIntoViewEventArgs>(h => This.RequestBringIntoView += h, h => This.RequestBringIntoView -= h)); }
private void InkPresenter_StrokesCollected(InkPresenter sender, InkStrokesCollectedEventArgs args) { System.Diagnostics.Debug.WriteLine("InkPresenter_StrokesCollected"); timer.Start(); }
public static IObservable <EventPattern <StylusButtonEventArgs> > PreviewStylusButtonUpObserver(this InkPresenter This) { return(Observable.FromEventPattern <StylusButtonEventHandler, StylusButtonEventArgs>(h => This.PreviewStylusButtonUp += h, h => This.PreviewStylusButtonUp -= h)); }
public static IObservable <EventPattern <KeyEventArgs> > PreviewKeyDownObserver(this InkPresenter This) { return(Observable.FromEventPattern <KeyEventHandler, KeyEventArgs>(h => This.PreviewKeyDown += h, h => This.PreviewKeyDown -= h)); }
private void InkPresenter_StrokesCollected(InkPresenter sender, InkStrokesCollectedEventArgs args) { try { ((App)App.Current).SyncStrokeEx(strokeMapping, ink.InkPresenter.StrokeContainer, ink.Width); } catch (Exception e) { #if DEBUG System.Diagnostics.Debug.WriteLine(e.Message); #endif } }
public static IObservable <EventPattern <KeyEventArgs> > KeyUpObserver(this InkPresenter This) { return(Observable.FromEventPattern <KeyEventHandler, KeyEventArgs>(h => This.KeyUp += h, h => This.KeyUp -= h)); }
private void InkPresenter_StrokesCollected(InkPresenter sender, InkStrokesCollectedEventArgs args) { foreach (var s in args.Strokes) { inkManager.AddStroke(s); } Debug.Assert(pendingDry == null); pendingDry = inkSynchronizer.BeginDry(); canvasControl.Invalidate(); }