12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- using PDF_Master.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter;
- using System.Windows.Controls;
- namespace PDF_Master.Views.Dialog.HomePageToolsDialogs.HomePagePrinter
- {
- /// <summary>
- /// Interaction logic for HomePagePrinterModSizeContent
- /// </summary>
- public partial class HomePagePrinterModSizeContent : UserControl
- {
- public HomePagePrinterModSizeContent()
- {
- InitializeComponent();
- }
- private void CustomRatioUpDown_Loaded(object sender, System.Windows.RoutedEventArgs e)
- {
- CustomRatioUpDown.TextBox_Num.KeyDown += TextBox_Num_KeyDown;
- CustomRatioUpDown.Button_Add.Click += Button_Add_Click;
- CustomRatioUpDown.Button_Sub.Click += Button_Sub_Click;
- CustomRatioUpDown.TextBox_Num.Text = ((HomePagePrinterModSizeContentViewModel)this.DataContext).DisplayRatio;
- }
- private void Button_Sub_Click(object sender, System.Windows.RoutedEventArgs e)
- {
- ((HomePagePrinterModSizeContentViewModel)this.DataContext).SetDisplayRatioCommand.Execute();
- }
- private void Button_Add_Click(object sender, System.Windows.RoutedEventArgs e)
- {
- ((HomePagePrinterModSizeContentViewModel)this.DataContext).SetDisplayRatioCommand.Execute();
- }
- private void TextBox_Num_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
- {
- if(e.Key == System.Windows.Input.Key.Enter)
- {
- ((HomePagePrinterModSizeContentViewModel)this.DataContext).SetDisplayRatioCommand.Execute();
- }
- }
- }
- }
|