using PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter; using System.Windows.Controls; namespace PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePagePrinter { /// /// Interaction logic for HomePagePrinterModPosterContent /// public partial class HomePagePrinterModPosterContent : UserControl { public HomePagePrinterModPosterContent() { InitializeComponent(); } private void CustomRatioUpDown_Loaded(object sender, System.Windows.RoutedEventArgs e) { CustomRatioUpDown.TextBox_Num.Text = ((HomePagePrinterModPosterContentViewModel)this.DataContext).TileRatio; CustomRatioUpDown.TextBox_Num.KeyDown += TextBox_Num_KeyDown; CustomRatioUpDown.Button_Add.Click += Button_Add_Click; CustomRatioUpDown.Button_Sub.Click += Button_Sub_Click; } private void Button_Sub_Click(object sender, System.Windows.RoutedEventArgs e) { ((HomePagePrinterModPosterContentViewModel)this.DataContext).SetTileRatioCommand.Execute(); } private void Button_Add_Click(object sender, System.Windows.RoutedEventArgs e) { ((HomePagePrinterModPosterContentViewModel)this.DataContext).SetTileRatioCommand.Execute(); } private void TextBox_Num_KeyDown(object sender, System.Windows.Input.KeyEventArgs e) { if (e.Key == System.Windows.Input.Key.Enter) { ((HomePagePrinterModPosterContentViewModel)this.DataContext).SetTileRatioCommand.Execute(); } } } }