Beispiel #1
0
        // get set makes it a dependancy property
        public PdfPageViewModel(SfPdfViewerControl pdfViewer)
        {
            Ink            = false;
            Rectangle      = false;
            Ellipse        = false;
            this.pdfViewer = pdfViewer;
            // Create commands
            InkPerformanceCommand = new RelayCommand <RoutedEventArgs>(InkPerformanceToggledCommand);
            InkCommand            = new RelayCommand(InkToggledCommand);
            RectangleCommand      = new RelayCommand(RectangleToggledCommand);
            EllipseCommand        = new RelayCommand(EllipseToggledCommand);
            OpenFileCommand       = new RelayCommand(OpenFileViewerCommand);
            SaveAsFileCommand     = new RelayCommand(SaveAsFileViewerCommand);
            //Allows event parameter to pass through
            SearchCommand                 = new RelayCommand <AutoSuggestBoxQuerySubmittedEventArgs>(SearchPdfCommand);
            OpacityInkSliderCommand       = new RelayCommand <RangeBaseValueChangedEventArgs>(OpacityInkCommand);
            SizeInkSliderCommand          = new RelayCommand <RangeBaseValueChangedEventArgs>(SizeInkCommand);
            OpacityRectangleSliderCommand = new RelayCommand <RangeBaseValueChangedEventArgs>(OpacityRectangleCommand);
            SizeRectangleSliderCommand    = new RelayCommand <RangeBaseValueChangedEventArgs>(SizeRectangleCommand);
            OpacityLineSliderCommand      = new RelayCommand <RangeBaseValueChangedEventArgs>(OpacityLineCommand);
            SizeLineSliderCommand         = new RelayCommand <RangeBaseValueChangedEventArgs>(SizeLineCommand);
            OpacityEllipseSliderCommand   = new RelayCommand <RangeBaseValueChangedEventArgs>(OpacityEllipseCommand);
            SizeEllipseSliderCommand      = new RelayCommand <RangeBaseValueChangedEventArgs>(SizeEllipseCommand);
            InkColorCommand               = new RelayCommand <ColorChangedEventArgs>(InkColorUpdateCommand);
            RectangleColorCommand         = new RelayCommand <ColorChangedEventArgs>(RectangleColorUpdateCommand);
            EllipseColorCommand           = new RelayCommand <ColorChangedEventArgs>(EllipseColorUpdateCommand);

            highlightCommand              = new RelayCommand(highlightToggledCommand);
            highlightColorCommand         = new RelayCommand <ColorChangedEventArgs>(highlightColorUpdateCommand);
            OpacityHighlightSliderCommand = new RelayCommand <RangeBaseValueChangedEventArgs>(OpacityhighlightCommand);
            highlight = false;

            lineCommand              = new RelayCommand(LineToggledCommand);
            LineColorCommand         = new RelayCommand <ColorChangedEventArgs>(LineColorUpdateCommand);
            Line                     = false;
            OpacityLineSliderCommand = new RelayCommand <RangeBaseValueChangedEventArgs>(OpacityLineCommand);
            SizeLineSliderCommand    = new RelayCommand <RangeBaseValueChangedEventArgs>(SizeLineCommand);

            StrikeoutCommand              = new RelayCommand(StrikeoutToggledCommand);
            StrikeoutColorCommand         = new RelayCommand <ColorChangedEventArgs>(StrikeoutColorUpdateCommand);
            Strikeout                     = false;
            OpacityStrikeoutSliderCommand = new RelayCommand <RangeBaseValueChangedEventArgs>(OpacityStrikeoutCommand);

            UnderlineCommand              = new RelayCommand(UnderlineToggledCommand);
            UnderlineColorCommand         = new RelayCommand <ColorChangedEventArgs>(UnderlineColorUpdateCommand);
            Underline                     = false;
            OpacityUnderlineSliderCommand = new RelayCommand <RangeBaseValueChangedEventArgs>(OpacityUnderlineCommand);
            PositionUpdatedCommand        = new RelayCommand <AutoSuggestBoxQuerySubmittedEventArgs>(PdfPositionCommand);
        }
Beispiel #2
0
 public CommentView()
 {
     this.InitializeComponent();
     PointerPressed += CommentView_PointerPressed;
     pdfViewer       = MainPageAccesser.MainPage.PdfViewer;
     textBox.Focus(FocusState.Pointer);
     if (MainPageAccesser.MainPage.SelectedCommentView != null)
     {
         MainPageAccesser.MainPage.SelectedCommentView.CollapseSelectedCommentView();
     }
     if (MainPageAccesser.MainPage.SelectedCommentListView != null)
     {
         MainPageAccesser.MainPage.SelectedCommentListView.CommentList.SelectedItem = null;
     }
     MainPageAccesser.MainPage.SelectedCommentView = this;
 }