NewFileDialog.cs 995 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using PixiEditor.Views;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using System.Windows;
  9. namespace PixiEditor.Models
  10. {
  11. public class NewFileDialog : CustomDialog
  12. {
  13. private int _width;
  14. public int Width
  15. {
  16. get { return _width; }
  17. set { if (_width != value) { _width = value; RaisePropertyChanged("Width"); } }
  18. }
  19. private int _height;
  20. public int Height
  21. {
  22. get { return _height; }
  23. set { if (_height != value) { _height = value; RaisePropertyChanged("Height"); } }
  24. }
  25. public override bool ShowDialog()
  26. {
  27. Window popup = new NewFilePopup();
  28. popup.ShowDialog();
  29. Height = (popup as NewFilePopup).FileHeight;
  30. Width = (popup as NewFilePopup).FileWidth;
  31. return (bool)popup.DialogResult;
  32. }
  33. }
  34. }