SaveFilePopup.xaml.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using PixiEditor.ViewModels;
  2. using System.Windows;
  3. namespace PixiEditor.Views
  4. {
  5. /// <summary>
  6. /// Interaction logic for SaveFilePopup.xaml
  7. /// </summary>
  8. public partial class SaveFilePopup : Window
  9. {
  10. public static readonly DependencyProperty SaveHeightProperty =
  11. DependencyProperty.Register("SaveHeight", typeof(int), typeof(SaveFilePopup), new PropertyMetadata(32));
  12. public static readonly DependencyProperty SaveWidthProperty =
  13. DependencyProperty.Register("SaveWidth", typeof(int), typeof(SaveFilePopup), new PropertyMetadata(32));
  14. private readonly SaveFilePopupViewModel dataContext = new SaveFilePopupViewModel();
  15. public SaveFilePopup()
  16. {
  17. InitializeComponent();
  18. Owner = Application.Current.MainWindow;
  19. DataContext = dataContext;
  20. }
  21. public int SaveWidth
  22. {
  23. get => (int)GetValue(SaveWidthProperty);
  24. set => SetValue(SaveWidthProperty, value);
  25. }
  26. public int SaveHeight
  27. {
  28. get => (int)GetValue(SaveHeightProperty);
  29. set => SetValue(SaveHeightProperty, value);
  30. }
  31. public string SavePath
  32. {
  33. get => dataContext.FilePath;
  34. set => dataContext.FilePath = value;
  35. }
  36. }
  37. }