NewFilePopup.xaml.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using System.Windows;
  2. using System.Windows.Input;
  3. namespace PixiEditor.Views
  4. {
  5. /// <summary>
  6. /// Interaction logic for NewFilePopup.xaml.
  7. /// </summary>
  8. public partial class NewFilePopup : Window
  9. {
  10. public static readonly DependencyProperty FileHeightProperty =
  11. DependencyProperty.Register(nameof(FileHeight), typeof(int), typeof(NewFilePopup));
  12. public static readonly DependencyProperty FileWidthProperty =
  13. DependencyProperty.Register(nameof(FileWidth), typeof(int), typeof(NewFilePopup));
  14. public NewFilePopup()
  15. {
  16. InitializeComponent();
  17. Owner = Application.Current.MainWindow;
  18. sizePicker.FocusWidthPicker();
  19. }
  20. public int FileHeight
  21. {
  22. get => (int)GetValue(FileHeightProperty);
  23. set => SetValue(FileHeightProperty, value);
  24. }
  25. public int FileWidth
  26. {
  27. get => (int)GetValue(FileWidthProperty);
  28. set => SetValue(FileWidthProperty, value);
  29. }
  30. private void CommandBinding_CanExecute(object sender, CanExecuteRoutedEventArgs e)
  31. {
  32. e.CanExecute = true;
  33. }
  34. private void CommandBinding_Executed_Close(object sender, ExecutedRoutedEventArgs e)
  35. {
  36. SystemCommands.CloseWindow(this);
  37. }
  38. }
  39. }