ImportFileDialog.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using PixiEditor.Views;
  2. namespace PixiEditor.Models.Dialogs
  3. {
  4. class ImportFileDialog : CustomDialog
  5. {
  6. private int _fileWidth;
  7. public int FileWidth
  8. {
  9. get { return _fileWidth; }
  10. set { if (_fileWidth != value) { _fileWidth = value; RaisePropertyChanged("Width"); } }
  11. }
  12. private int _fileHeight;
  13. public int FileHeight
  14. {
  15. get { return _fileHeight; }
  16. set { if (_fileHeight != value) { _fileHeight = value; RaisePropertyChanged("FileHeight"); } }
  17. }
  18. private string _filePath;
  19. public string FilePath
  20. {
  21. get { return _filePath; }
  22. set { if (_filePath != value) { _filePath = value; RaisePropertyChanged("FilePath"); } }
  23. }
  24. public override bool ShowDialog()
  25. {
  26. ImportFilePopup popup = new ImportFilePopup();
  27. popup.ShowDialog();
  28. if (popup.DialogResult == true)
  29. {
  30. FileHeight = popup.ImportHeight;
  31. FileWidth = popup.ImportWidth;
  32. FilePath = popup.FilePath;
  33. }
  34. return (bool)popup.DialogResult;
  35. }
  36. }
  37. }