123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- using PixiEditor.Models.Enums;
- using PixiEditor.Views;
- using System.Windows;
- namespace PixiEditor.Models.Dialogs
- {
- public class ExportFileDialog : CustomDialog
- {
- FileType _chosenFormat;
- private int fileHeight;
- private string filePath;
- private int fileWidth;
- public ExportFileDialog(Size fileDimensions)
- {
- FileHeight = (int)fileDimensions.Height;
- FileWidth = (int)fileDimensions.Width;
- }
- public int FileWidth
- {
- get => fileWidth;
- set
- {
- if (fileWidth != value)
- {
- fileWidth = value;
- RaisePropertyChanged("Width");
- }
- }
- }
- public int FileHeight
- {
- get => fileHeight;
- set
- {
- if (fileHeight != value)
- {
- fileHeight = value;
- RaisePropertyChanged("FileHeight");
- }
- }
- }
- public string FilePath
- {
- get => filePath;
- set
- {
- if (filePath != value)
- {
- filePath = value;
- RaisePropertyChanged("FilePath");
- }
- }
- }
- public FileType ChosenFormat
- {
- get => _chosenFormat;
- set
- {
- if (_chosenFormat != value)
- {
- _chosenFormat = value;
- RaisePropertyChanged(nameof(ChosenFormat));
- }
- }
- }
- public override bool ShowDialog()
- {
- ExportFilePopup popup = new ExportFilePopup(FileWidth, FileHeight);
- popup.ShowDialog();
- if (popup.DialogResult == true)
- {
- FileWidth = popup.SaveWidth;
- FileHeight = popup.SaveHeight;
- FilePath = popup.SavePath;
- ChosenFormat = popup.SaveFormat;
- }
- return (bool)popup.DialogResult;
- }
- }
- }
|