SignatureCreateDialog.xaml.cs 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. }
  28. private void TextRadioButton_Checked(object sender, RoutedEventArgs e)
  29. {
  30. (DataContext as SignatureCreateDialogViewModel).UpDataRadioButtonIndex(Convert.ToInt32((sender as RadioButton).Tag));
  31. }
  32. private void ImageRadioButton_Checked(object sender, RoutedEventArgs e)
  33. {
  34. (DataContext as SignatureCreateDialogViewModel).UpDataImageRadioButtonIndex(Convert.ToInt32((sender as RadioButton).Tag));
  35. }
  36. private void TextBoxEx_TextChanged(object sender, TextChangedEventArgs e)
  37. {
  38. if (sender is TextBoxEx)
  39. {
  40. if (string.IsNullOrEmpty((sender as TextBoxEx).Text))
  41. {
  42. (DataContext as SignatureCreateDialogViewModel).ShowTextButton = Visibility.Collapsed;
  43. }
  44. else
  45. {
  46. (DataContext as SignatureCreateDialogViewModel).ShowTextButton = Visibility.Visible;
  47. }
  48. }
  49. }
  50. private void inkCanvas_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
  51. {
  52. (DataContext as SignatureCreateDialogViewModel).IsMouseDown = true;
  53. }
  54. private void inkCanvas_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
  55. {
  56. (DataContext as SignatureCreateDialogViewModel).IsMouseDown = false;
  57. }
  58. private void UserControl_Loaded(object sender, RoutedEventArgs e)
  59. {
  60. DialogHeader.Header = App.MainPageLoader.GetString("Signatur_DialogTitle");
  61. BtnOK.Content = App.MainPageLoader.GetString("Signatur_DialogYes");
  62. BtnNo.Content = App.MainPageLoader.GetString("Signatur_DialogNo");
  63. InputItem.Header = App.MainPageLoader.GetString("Signatur_DialogText");
  64. InPutTextBox.PlaceholderText = App.MainPageLoader.GetString("Signatur_DialogTextHint");
  65. BtnTextClear.Content = App.MainPageLoader.GetString("Signatur_DialogClear");
  66. DrawItem.Header = App.MainPageLoader.GetString("Signatur_DialogDraw");
  67. DrawHint.Text = App.MainPageLoader.GetString("Signatur_DialogPictureHint");
  68. BtnDrawClear.Content = App.MainPageLoader.GetString("Signatur_DialogClear");
  69. PictureItem.Header = App.MainPageLoader.GetString("Signatur_DialogPicture");
  70. BtnPictureReselect.Content= App.MainPageLoader.GetString("Signatur_DialogPictureReselect");
  71. ImageHint.Text = App.MainPageLoader.GetString("Signatur_DialogPictureHint");
  72. BtnReBkg.Text = App.MainPageLoader.GetString("Signatur_DialogPictureReBkg");
  73. BtnReBkgHint.Content = App.MainPageLoader.GetString("Signatur_DialogPictureReBkgHint");
  74. }
  75. }
  76. }