Welcome to mirror list, hosted at ThFree Co, Russian Federation.

ToolLayerExportHeatMapControl.axaml.cs « Tools « Controls « UVtools.WPF - github.com/sn4k3/UVtools.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6c6d74e8af009ce993b0fdb12f060f67f087809b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using System.Collections.Generic;
using System.IO;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using UVtools.Core.Operations;

namespace UVtools.WPF.Controls.Tools
{
    public partial class ToolLayerExportHeatMapControl : ToolControl
    {
        public OperationLayerExportHeatMap Operation => BaseOperation as OperationLayerExportHeatMap;
        public ToolLayerExportHeatMapControl()
        {
            InitializeComponent();
            BaseOperation = new OperationLayerExportHeatMap(SlicerFile);
        }

        private void InitializeComponent()
        {
            AvaloniaXamlLoader.Load(this);
        }

        public async void ChooseFilePath()
        {
            var dialog = new SaveFileDialog
            {
                Filters = Helpers.ImagesFullFileFilter,
                InitialFileName = Path.GetFileName(SlicerFile.FileFullPath) + ".heatmap.png",
                Directory = Path.GetDirectoryName(SlicerFile.FileFullPath),
            };
            var file = await dialog.ShowAsync(ParentWindow);
            if (string.IsNullOrWhiteSpace(file)) return;
            Operation.FilePath = file;
        }
    }
}