SignatureCreateDialog.xaml.cs 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. using PDF_Office.CustomControl;
  2. using PDF_Office.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_Office.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. }
  59. }