SignatureCreateDialog.xaml.cs 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. using PDF_Master.CustomControl;
  2. using PDF_Master.ViewModels.PropertyPanel.AnnotPanel;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using System.Windows;
  9. using System.Windows.Controls;
  10. using System.Windows.Data;
  11. using System.Windows.Documents;
  12. using System.Windows.Input;
  13. using System.Windows.Media;
  14. using System.Windows.Media.Imaging;
  15. using System.Windows.Navigation;
  16. using System.Windows.Shapes;
  17. namespace PDF_Master.Views.PropertyPanel.AnnotPanel
  18. {
  19. /// <summary>
  20. /// SignatureCreateDialog.xaml 的交互逻辑
  21. /// </summary>
  22. public partial class SignatureCreateDialog : UserControl
  23. {
  24. public SignatureCreateDialog()
  25. {
  26. InitializeComponent();
  27. InPutTextBox.Focus();
  28. }
  29. private void TextRadioButton_Checked(object sender, RoutedEventArgs e)
  30. {
  31. (DataContext as SignatureCreateDialogViewModel).UpDataRadioButtonIndex(Convert.ToInt32((sender as RadioButton).Tag));
  32. }
  33. private void ImageRadioButton_Checked(object sender, RoutedEventArgs e)
  34. {
  35. (DataContext as SignatureCreateDialogViewModel).UpDataImageRadioButtonIndex(Convert.ToInt32((sender as RadioButton).Tag));
  36. }
  37. private void TextBoxEx_TextChanged(object sender, TextChangedEventArgs e)
  38. {
  39. if (sender is TextBoxEx)
  40. {
  41. if (string.IsNullOrEmpty((sender as TextBoxEx).Text))
  42. {
  43. (DataContext as SignatureCreateDialogViewModel).ShowTextButton = Visibility.Collapsed;
  44. }
  45. else
  46. {
  47. (DataContext as SignatureCreateDialogViewModel).ShowTextButton = Visibility.Visible;
  48. }
  49. }
  50. }
  51. private void inkCanvas_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
  52. {
  53. (DataContext as SignatureCreateDialogViewModel).IsMouseDown = true;
  54. if ((DataContext as SignatureCreateDialogViewModel).UpdataDrawingStrokesCommnad.CanExecute())
  55. {
  56. (DataContext as SignatureCreateDialogViewModel).UpdataDrawingStrokesCommnad.Execute();
  57. }
  58. }
  59. private void inkCanvas_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
  60. {
  61. (DataContext as SignatureCreateDialogViewModel).IsMouseDown = false;
  62. }
  63. private void UserControl_Loaded(object sender, RoutedEventArgs e)
  64. {
  65. DialogHeader.Header = App.MainPageLoader.GetString("Signatur_DialogTitle");
  66. BtnOK.Content = App.MainPageLoader.GetString("Signatur_DialogYes");
  67. BtnNo.Content = App.MainPageLoader.GetString("Signatur_DialogNo");
  68. InputItem.Header = App.MainPageLoader.GetString("Signatur_DialogText");
  69. InPutTextBox.PlaceholderText = App.MainPageLoader.GetString("Signatur_DialogTextHint");
  70. BtnTextClear.Content = App.MainPageLoader.GetString("Signatur_DialogClear");
  71. DrawItem.Header = App.MainPageLoader.GetString("Signatur_DialogDraw");
  72. DrawHint.Text = App.MainPageLoader.GetString("Signatur_DialogDrawHint");
  73. BtnDrawClear.Content = App.MainPageLoader.GetString("Signatur_DialogClear");
  74. PictureItem.Header = App.MainPageLoader.GetString("Signatur_DialogPicture");
  75. BtnPictureReselect.Content= App.MainPageLoader.GetString("Signatur_DialogPictureReselect");
  76. ImageHint.Text = App.MainPageLoader.GetString("Signatur_DialogPictureHint");
  77. BtnReBkg.Text = App.MainPageLoader.GetString("Signatur_DialogPictureReBkg");
  78. BtnReBkgHint.Content = App.MainPageLoader.GetString("Signatur_DialogPictureReBkgHint");
  79. }
  80. }
  81. }