public NewDocumentDialog() { InitializeComponent(); DocumentWidth = 80; DocumentHeight = 80; EnableCompression = true; WidthTextBox.Text = DocumentWidth.ToString(); HeightTextBox.Text = DocumentHeight.ToString(); }
private void HeightTextBox_OnLostFocus(object sender, RoutedEventArgs e) { if (sender is TextBox textBox) { if (int.TryParse(textBox.Text, out var height)) { DocumentHeight = height; } else { textBox.Text = DocumentHeight.ToString(); } } }