123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- using Compdfkit_Tools.PDFControl;
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Linq;
- using System.Runtime.CompilerServices;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using System.Windows.Navigation;
- using System.Windows.Shapes;
- namespace Compdfkit_Tools.PDFControl
- {
- /// <summary>
- /// DigitalSignatureControl.xaml 的交互逻辑
- /// </summary>
- public partial class DigitalSignatureControl : UserControl, INotifyPropertyChanged
- {
- private bool isFirstLoad = true;
- public PDFViewControl PdfViewControl = new PDFViewControl();
- private bool _isActive = false;
- public event PropertyChangedEventHandler PropertyChanged;
- protected void OnPropertyChanged([CallerMemberName] string name = null)
- {
- PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
- }
- public bool IsActive
- {
- get => _isActive;
- set
- {
- _isActive = value;
- OnPropertyChanged();
- }
- }
- public bool CanUndo
- {
- get
- {
- if (PdfViewControl != null && PdfViewControl.PDFView != null)
- {
- return PdfViewControl.PDFView.UndoManager.CanUndo;
- }
- return false;
- }
- }
- public bool CanRedo
- {
- get
- {
- if (PdfViewControl != null && PdfViewControl.PDFView != null)
- {
- return PdfViewControl.PDFView.UndoManager.CanRedo;
- }
- return false;
- }
- }
- public DigitalSignatureControl()
- {
- InitializeComponent();
- }
- private void UserControl_Loaded(object sender, RoutedEventArgs e)
- {
- }
- private void UserControl_UnLoaded(object sender, RoutedEventArgs e)
- {
- }
- private void AnnotationBarControl_Loaded(object sender, RoutedEventArgs e)
- {
- }
- private void DigitalSignatureBarControl_Unloaded(object sender, RoutedEventArgs e)
- {
- if (PdfViewControl != null && PdfViewControl.PDFView != null && CanUndo)
- {
- PdfViewControl.PDFView.UndoManager?.Undo();
- }
- }
- private void CommandBinding_Executed_Undo(object sender, ExecutedRoutedEventArgs e)
- {
- if (PdfViewControl != null && PdfViewControl.PDFView != null && CanUndo)
- {
- PdfViewControl.PDFView.UndoManager?.Undo();
- }
- }
- private void CommandBinding_Executed_Redo(object sender, ExecutedRoutedEventArgs e)
- {
- }
- private void UndoButton_Click(object sender, RoutedEventArgs e)
- {
- }
- private void RedoButton_Click(object sender, RoutedEventArgs e)
- {
- }
- }
- }
|