ImportFileDialog.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. using PixiEditor.Views;
  2. namespace PixiEditor.Models.Dialogs
  3. {
  4. internal class ImportFileDialog : CustomDialog
  5. {
  6. private int fileHeight;
  7. private string filePath;
  8. private int fileWidth;
  9. public int FileWidth
  10. {
  11. get => fileWidth;
  12. set
  13. {
  14. if (fileWidth != value)
  15. {
  16. fileWidth = value;
  17. RaisePropertyChanged("Width");
  18. }
  19. }
  20. }
  21. public int FileHeight
  22. {
  23. get => fileHeight;
  24. set
  25. {
  26. if (fileHeight != value)
  27. {
  28. fileHeight = value;
  29. RaisePropertyChanged("FileHeight");
  30. }
  31. }
  32. }
  33. public string FilePath
  34. {
  35. get => filePath;
  36. set
  37. {
  38. if (filePath != value)
  39. {
  40. filePath = value;
  41. RaisePropertyChanged("FilePath");
  42. }
  43. }
  44. }
  45. public override bool ShowDialog()
  46. {
  47. ImportFilePopup popup = new ImportFilePopup
  48. {
  49. FilePath = FilePath
  50. };
  51. popup.ShowDialog();
  52. if (popup.DialogResult == true)
  53. {
  54. FileHeight = popup.ImportHeight;
  55. FileWidth = popup.ImportWidth;
  56. FilePath = popup.FilePath;
  57. }
  58. return (bool)popup.DialogResult;
  59. }
  60. }
  61. }