diff options
Diffstat (limited to 'UVtools.WPF/Controls/Tools/ToolLayerExportSkeletonControl.axaml.cs')
-rw-r--r-- | UVtools.WPF/Controls/Tools/ToolLayerExportSkeletonControl.axaml.cs | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/UVtools.WPF/Controls/Tools/ToolLayerExportSkeletonControl.axaml.cs b/UVtools.WPF/Controls/Tools/ToolLayerExportSkeletonControl.axaml.cs new file mode 100644 index 0000000..02091f4 --- /dev/null +++ b/UVtools.WPF/Controls/Tools/ToolLayerExportSkeletonControl.axaml.cs @@ -0,0 +1,36 @@ +using System.IO; +using Avalonia; +using Avalonia.Controls; +using Avalonia.Markup.Xaml; +using UVtools.Core.Operations; + +namespace UVtools.WPF.Controls.Tools +{ + public partial class ToolLayerExportSkeletonControl : ToolControl + { + public OperationLayerExportSkeleton Operation => BaseOperation as OperationLayerExportSkeleton; + public ToolLayerExportSkeletonControl() + { + InitializeComponent(); + BaseOperation = new OperationLayerExportSkeleton(SlicerFile); + } + + private void InitializeComponent() + { + AvaloniaXamlLoader.Load(this); + } + + public async void ChooseFilePath() + { + var dialog = new SaveFileDialog + { + Filters = Helpers.ImagesFullFileFilter, + InitialFileName = Path.GetFileName(SlicerFile.FileFullPath) + ".skeleton.png", + Directory = Path.GetDirectoryName(SlicerFile.FileFullPath), + }; + var file = await dialog.ShowAsync(ParentWindow); + if (string.IsNullOrWhiteSpace(file)) return; + Operation.FilePath = file; + } + } +} |