ImportFileDialog.cs 1.3 KB

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