ImportFilePopup.xaml.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using PixiEditor.ViewModels;
  2. using System.Windows;
  3. using System.Windows.Input;
  4. namespace PixiEditor.Views
  5. {
  6. public partial class ImportFilePopup : Window
  7. {
  8. private readonly ImportFilePopupViewModel dc = new ImportFilePopupViewModel();
  9. public ImportFilePopup()
  10. {
  11. InitializeComponent();
  12. DataContext = dc;
  13. Loaded += (_, _) => sizePicker.FocusWidthPicker();
  14. }
  15. public int ImportHeight
  16. {
  17. get => dc.ImportHeight;
  18. set => dc.ImportWidth = value;
  19. }
  20. public int ImportWidth
  21. {
  22. get => dc.ImportWidth;
  23. set => dc.ImportWidth = value;
  24. }
  25. public string FilePath
  26. {
  27. get => dc.FilePath;
  28. set => dc.FilePath = 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. }