BatesCreateContent.xaml.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using PDF_Master.ViewModels.EditTools.Bates;
  2. using PDF_Master.ViewModels.EditTools.HeaderFooter;
  3. using System.Windows.Controls;
  4. using System.Windows.Media;
  5. namespace PDF_Master.Views.EditTools.Bates
  6. {
  7. /// <summary>
  8. /// Interaction logic for BatesCreateContent
  9. /// </summary>
  10. public partial class BatesCreateContent : UserControl
  11. {
  12. private BatesCreateContentViewModel viewModel;
  13. public BatesCreateContent()
  14. {
  15. InitializeComponent();
  16. viewModel = this.DataContext as BatesCreateContentViewModel;
  17. cusColor.SelectedColorHandler += cusColor_SelectedColor;
  18. }
  19. private void cusColor_SelectedColor(object sender, Color e)
  20. {
  21. var data = this.DataContext as BatesCreateContentViewModel;
  22. if (data != null)
  23. {
  24. data.SelectedColorChangedCommand?.Execute(e);
  25. }
  26. }
  27. private void ADDBates_Click(object sender, System.Windows.RoutedEventArgs e)
  28. {
  29. viewModel.ADDBatesCommand?.Execute();
  30. }
  31. private void Button_Click(object sender, System.Windows.RoutedEventArgs e)
  32. {
  33. contextMenu.IsOpen = true;
  34. }
  35. }
  36. }