FreehandAnnotProperty.xaml.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using ComPDFKitViewer;
  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. /// FreehandAnnotProperty.xaml 的交互逻辑
  21. /// </summary>
  22. public partial class FreehandAnnotProperty : UserControl
  23. {
  24. private FreehandAnnotPropertyViewModel ViewModel => DataContext as FreehandAnnotPropertyViewModel;
  25. public FreehandAnnotProperty()
  26. {
  27. InitializeComponent();
  28. cusColor.SelectedColorHandler += cusColor_SelectedColor;
  29. }
  30. private void cusColor_SelectedColor(object sender, Color e)
  31. {
  32. if (ViewModel != null)
  33. {
  34. ViewModel.SelectedColorChangedCommand?.Execute(e);
  35. }
  36. }
  37. private void UserControl_Loaded(object sender, RoutedEventArgs e)
  38. {
  39. if (ViewModel != null && ViewModel.IsFirst)
  40. {
  41. //暂时解决方案,让其先等于高保真所需的默认值,然后在变为注释setting默认颜色值
  42. ViewModel.IsFirst = false;
  43. ViewModel.BasicVm.CurrentFontColor = App.Current.FindResource("color.sys.layout.divider.pen") as Brush;
  44. ViewModel.BasicVm.FontColor = ViewModel.BasicVm.FontColor;
  45. }
  46. }
  47. }
  48. }