diff options
Diffstat (limited to 'UVtools.WPF/Controls/Tools/ToolLayerExportImageControl.axaml.cs')
-rw-r--r-- | UVtools.WPF/Controls/Tools/ToolLayerExportImageControl.axaml.cs | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/UVtools.WPF/Controls/Tools/ToolLayerExportImageControl.axaml.cs b/UVtools.WPF/Controls/Tools/ToolLayerExportImageControl.axaml.cs new file mode 100644 index 0000000..08f5df5 --- /dev/null +++ b/UVtools.WPF/Controls/Tools/ToolLayerExportImageControl.axaml.cs @@ -0,0 +1,34 @@ +using System.IO; +using Avalonia.Controls; +using Avalonia.Markup.Xaml; +using UVtools.Core.Operations; + +namespace UVtools.WPF.Controls.Tools +{ + public partial class ToolLayerExportImageControl : ToolControl + { + public OperationLayerExportImage Operation => BaseOperation as OperationLayerExportImage; + public ToolLayerExportImageControl() + { + BaseOperation = new OperationLayerExportImage(SlicerFile); + if (!ValidateSpawn()) return; + InitializeComponent(); + } + + private void InitializeComponent() + { + AvaloniaXamlLoader.Load(this); + } + + public async void ChooseFolder() + { + var dialog = new OpenFolderDialog + { + Directory = Path.GetDirectoryName(SlicerFile.FileFullPath), + }; + var folder = await dialog.ShowAsync(ParentWindow); + if (string.IsNullOrWhiteSpace(folder)) return; + Operation.OutputFolder = folder; + } + } +} |