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

github.com/sn4k3/UVtools.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'UVtools.WPF/Windows/ToolWindow.axaml.cs')
-rw-r--r--UVtools.WPF/Windows/ToolWindow.axaml.cs24
1 files changed, 16 insertions, 8 deletions
diff --git a/UVtools.WPF/Windows/ToolWindow.axaml.cs b/UVtools.WPF/Windows/ToolWindow.axaml.cs
index 2eb4725..e3936d3 100644
--- a/UVtools.WPF/Windows/ToolWindow.axaml.cs
+++ b/UVtools.WPF/Windows/ToolWindow.axaml.cs
@@ -1,10 +1,8 @@
using System;
using System.Collections.ObjectModel;
-using System.Diagnostics;
using System.Drawing;
using Avalonia;
using Avalonia.Controls;
-using Avalonia.Controls.Primitives;
using Avalonia.Input;
using Avalonia.Markup.Xaml;
using Avalonia.Threading;
@@ -109,7 +107,7 @@ namespace UVtools.WPF.Windows
get => _layerIndexStart;
set
{
- if (!(ToolControl?.BaseOperation is null))
+ if (ToolControl?.BaseOperation is not null)
{
ToolControl.BaseOperation.LayerRangeSelection = Enumerations.LayerRangeSelection.None;
ToolControl.BaseOperation.LayerIndexStart = value;
@@ -294,7 +292,17 @@ namespace UVtools.WPF.Windows
operation.ProfileName = null;
operation.SlicerFile = App.SlicerFile;
ToolControl.BaseOperation = operation;
- SelectLayers(operation.LayerRangeSelection);
+ switch (operation.LayerRangeSelection)
+ {
+ case Enumerations.LayerRangeSelection.None:
+ LayerIndexStart = operation.LayerIndexStart;
+ LayerIndexEnd = operation.LayerIndexEnd;
+ break;
+ default:
+ SelectLayers(operation.LayerRangeSelection);
+ break;
+ }
+
ToolControl.Callback(Callbacks.ProfileLoaded);
ToolControl.ResetDataContext();
}
@@ -504,14 +512,14 @@ namespace UVtools.WPF.Windows
_buttonOkText = toolControl.BaseOperation.ButtonOkText;
_buttonOkVisible = ButtonOkEnabled = toolControl.BaseOperation.HaveAction;
- if (toolControl.BaseOperation.LayerIndexStart == 0 && toolControl.BaseOperation.LayerIndexEnd == 0)
+ if (toolControl.BaseOperation.HaveExecuted) // Come from a redo or something
{
- SelectLayers(toolControl.BaseOperation.StartLayerRangeSelection);
+ LayerIndexStart = toolControl.BaseOperation.LayerIndexStart;
+ LayerIndexEnd = toolControl.BaseOperation.LayerIndexEnd;
}
else
{
- LayerIndexStart = toolControl.BaseOperation.LayerIndexStart;
- LayerIndexEnd = toolControl.BaseOperation.LayerIndexEnd;
+ SelectLayers(toolControl.BaseOperation.StartLayerRangeSelection);
}
//RaisePropertyChanged(nameof(IsContentVisible));