ShapFillProperty.xaml.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. using ComPDFKitViewer;
  2. using PDF_Office.ViewModels.FillAndSign.PropertyPanel;
  3. using PDF_Office.ViewModels.PropertyPanel.AnnotPanel;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows;
  10. using System.Windows.Controls;
  11. using System.Windows.Controls.Primitives;
  12. using System.Windows.Data;
  13. using System.Windows.Documents;
  14. using System.Windows.Input;
  15. using System.Windows.Media;
  16. using System.Windows.Media.Imaging;
  17. using System.Windows.Navigation;
  18. using System.Windows.Shapes;
  19. namespace PDF_Office.Views.FillAndSign.PropertyPanel
  20. {
  21. /// <summary>
  22. /// ShapFillProperty.xaml 的交互逻辑
  23. /// </summary>
  24. public partial class ShapFillProperty : UserControl
  25. {
  26. private ShapFillPropertyViewModel ViewModel => DataContext as ShapFillPropertyViewModel;
  27. public ShapFillProperty()
  28. {
  29. InitializeComponent();
  30. InitializeComponent();
  31. cusColor.SelectedColorHandler += cusColor_SelectedColor;
  32. //ViewModel.LoadPropertyHandler += ViewModel_LoadPropertyHandler;
  33. }
  34. private void cusColor_SelectedColor(object sender, Color e)
  35. {
  36. if (ViewModel != null)
  37. {
  38. ViewModel.SelectedColorCommand?.Execute(e);
  39. }
  40. }
  41. private void SharpsBtn_Click(object sender, RoutedEventArgs e)
  42. {
  43. var btn = sender as ToggleButton;
  44. foreach (var item in ToolGrid.Children)
  45. {
  46. var btnItem = item as ToggleButton;
  47. if (btnItem != null)
  48. {
  49. if (btnItem != btn)
  50. {
  51. btnItem.IsChecked = false;
  52. }
  53. else
  54. {
  55. btnItem.IsChecked = true;
  56. }
  57. }
  58. }
  59. }
  60. }
  61. }