HomePageHeaderFooterCreateContent.xaml.cs 1.6 KB

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