SharpsAnnotProperty.xaml.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. using ComPDFKit.PDFAnnotation;
  2. using ComPDFKitViewer.AnnotEvent;
  3. using PDF_Office.CustomControl;
  4. using PDF_Office.ViewModels.PropertyPanel.AnnotPanel;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. using System.Windows;
  11. using System.Windows.Controls;
  12. using System.Windows.Controls.Primitives;
  13. using System.Windows.Data;
  14. using System.Windows.Documents;
  15. using System.Windows.Input;
  16. using System.Windows.Media;
  17. using System.Windows.Media.Imaging;
  18. using System.Windows.Navigation;
  19. using System.Windows.Shapes;
  20. namespace PDF_Office.Views.PropertyPanel.AnnotPanel
  21. {
  22. /// <summary>
  23. /// SharpsAnnotProperty.xaml 的交互逻辑
  24. /// </summary>
  25. public partial class SharpsAnnotProperty : UserControl
  26. {
  27. private SharpsAnnotPropertyViewModel ViewModel => DataContext as SharpsAnnotPropertyViewModel;
  28. public SharpsAnnotProperty()
  29. {
  30. InitializeComponent();
  31. this.Loaded += Usercontrol_Loaded;
  32. }
  33. private void Usercontrol_Loaded(object sender, RoutedEventArgs e)
  34. {
  35. if(ViewModel != null)
  36. {
  37. var str = ViewModel.BasicVm.strOtherTag;
  38. if (str == "Rect")
  39. {
  40. SharpRectBtn.IsChecked = true;
  41. }
  42. else if(str == "Circle")
  43. {
  44. SharpCircleBtn.IsChecked = true;
  45. }
  46. else if(str == "Arrow")
  47. {
  48. SharpArrowBtn.IsChecked = true;
  49. }
  50. else if(str == "Line")
  51. {
  52. SharpLineBtn.IsChecked = true;
  53. }
  54. }
  55. }
  56. }
  57. }