private async void Eraser_Click(object sender, RoutedEventArgs e) { ClearInputTypeToggleBtn(); AppEventSource.Log.Debug("ViewerPage: Eraser selected"); this.Eraser.IsChecked = true; this.drawingAttributes.Size = inkingPreference.GetPenSize(pdfModel.ScaleRatio()); this.drawingAttributes.PenTip = PenTipShape.Circle; this.drawingAttributes.DrawAsHighlighter = false; this.drawingAttributes.PenTipTransform = System.Numerics.Matrix3x2.Identity; this.inkProcessMode = InkInputProcessingMode.Erasing; UpdateInkPresenter(); // Notify user about the risk when using eraser for the first time. if ((bool)App.AppSettings[App.ERASER_WARNING]) { int userResponse = await App.NotifyUserWithOptions(Messages.ERASER_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.ERASER_WARNING] = false; App.AppSettings[App.ERASER_WARNING] = false; break; default: App.AppSettings[App.ERASER_WARNING] = false; break; } } }
private void InitializeZoomInView() { this.imagePanel.Children.Clear(); this.imagePanel.UpdateLayout(); this.inkingPageRange = new PageRange(); this._visiblePageRange = new PageRange(); this._viewerKey = new Guid(); this.pageCount = 0; this.inkCanvasList = new List<int>(); this.renderedPages = new List<int>(); this.recyclePagesQueue = new Queue<int>(); this.renderPagesQueue = new Queue<int>(); this.isRenderingPage = false; this.inkProcessMode = InkInputProcessingMode.Inking; this.recycleTimer.Stop(); this.fullScreenCover.Visibility = Visibility.Visible; this.fullScreenMessage.Text = DEFAULT_FULL_SCREEN_MSG; this.pageNumberTextBlock.Text = ""; this.filenameTextBlock.Text = ""; this.imagePanel.Orientation = Orientation.Vertical; this.semanticZoom.IsZoomedInViewActive = true; ClearViewModeToggleBtn(); this.VerticalViewBtn.IsChecked = true; this.pageThumbnails = null; if (NavigationPage.Current != null) NavigationPage.Current.InitializeViewBtn(); AppEventSource.Log.Debug("ViewerPage: Viewer panel and settings initialized."); }
private void Highlighter_Click(object sender, RoutedEventArgs e) { ClearInputTypeToggleBtn(); AppEventSource.Log.Debug("ViewerPage: Highlighter selected"); this.Highlighter.IsChecked = true; this.drawingAttributes.Size = inkingPreference.GetHighlighterSize(pdfModel.ScaleRatio()); this.drawingAttributes.Color = inkingPreference.highlighterColor; this.drawingAttributes.PenTip = PenTipShape.Rectangle; this.drawingAttributes.DrawAsHighlighter = true; this.drawingAttributes.PenTipTransform = System.Numerics.Matrix3x2.Identity; this.drawingAttributes.IgnorePressure = true; this.drawingAttributes.FitToCurve = false; this.inkProcessMode = InkInputProcessingMode.Inking; UpdateInkPresenter(); }