HeaderFooterCreateContent.xaml.cs 1.4 KB

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