ShapFillProperty.xaml.cs 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. using ComPDFKitViewer;
  2. using PDF_Master.ViewModels.FillAndSign.PropertyPanel;
  3. using PDF_Master.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_Master.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. cusColor.SelectedColorHandler += cusColor_SelectedColor;
  31. //ViewModel.LoadPropertyHandler += ViewModel_LoadPropertyHandler;
  32. }
  33. private void cusColor_SelectedColor(object sender, Color e)
  34. {
  35. if (ViewModel != null)
  36. {
  37. ViewModel.SelectedColorCommand?.Execute(e);
  38. }
  39. }
  40. private void SharpsBtn_Click(object sender, RoutedEventArgs e)
  41. {
  42. var btn = sender as ToggleButton;
  43. foreach (var item in ToolGrid.Children)
  44. {
  45. var btnItem = item as ToggleButton;
  46. if (btnItem != null)
  47. {
  48. if (btnItem != btn)
  49. {
  50. btnItem.IsChecked = false;
  51. }
  52. else
  53. {
  54. btnItem.IsChecked = true;
  55. }
  56. }
  57. }
  58. }
  59. }
  60. }