HomePageBatesCreateContent.xaml.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageBates;
  2. using PDF_Office.ViewModels.EditTools.Bates;
  3. using System.Windows.Controls;
  4. using System.Windows.Media;
  5. namespace PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageBates
  6. {
  7. /// <summary>
  8. /// Interaction logic for HomePageBatesCreateContent
  9. /// </summary>
  10. public partial class HomePageBatesCreateContent : UserControl
  11. {
  12. private HomePageBatesCreateContentViewModel viewModel;
  13. public HomePageBatesCreateContent()
  14. {
  15. viewModel = this.DataContext as HomePageBatesCreateContentViewModel;
  16. InitializeComponent();
  17. cusColor.SelectedColorHandler += cusColor_SelectedColor;
  18. }
  19. private void cusColor_SelectedColor(object sender, Color e)
  20. {
  21. var data = this.DataContext as HomePageBatesCreateContentViewModel;
  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. }