HomePagePrinterModPosterContent.xaml.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using PDF_Master.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter;
  2. using System.Windows.Controls;
  3. namespace PDF_Master.Views.Dialog.HomePageToolsDialogs.HomePagePrinter
  4. {
  5. /// <summary>
  6. /// Interaction logic for HomePagePrinterModPosterContent
  7. /// </summary>
  8. public partial class HomePagePrinterModPosterContent : UserControl
  9. {
  10. public HomePagePrinterModPosterContent()
  11. {
  12. InitializeComponent();
  13. }
  14. private void CustomRatioUpDown_Loaded(object sender, System.Windows.RoutedEventArgs e)
  15. {
  16. CustomRatioUpDown.TextBox_Num.Text = ((HomePagePrinterModPosterContentViewModel)this.DataContext).TileRatio;
  17. CustomRatioUpDown.TextBox_Num.KeyDown += TextBox_Num_KeyDown;
  18. CustomRatioUpDown.Button_Add.Click += Button_Add_Click;
  19. CustomRatioUpDown.Button_Sub.Click += Button_Sub_Click;
  20. }
  21. private void Button_Sub_Click(object sender, System.Windows.RoutedEventArgs e)
  22. {
  23. ((HomePagePrinterModPosterContentViewModel)this.DataContext).SetTileRatioCommand.Execute();
  24. }
  25. private void Button_Add_Click(object sender, System.Windows.RoutedEventArgs e)
  26. {
  27. ((HomePagePrinterModPosterContentViewModel)this.DataContext).SetTileRatioCommand.Execute();
  28. }
  29. private void TextBox_Num_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
  30. {
  31. if (e.Key == System.Windows.Input.Key.Enter)
  32. {
  33. ((HomePagePrinterModPosterContentViewModel)this.DataContext).SetTileRatioCommand.Execute();
  34. }
  35. }
  36. }
  37. }