diff options
Diffstat (limited to 'UVtools.WPF/Controls/Tools/ToolLayerArithmeticControl.axaml.cs')
-rw-r--r-- | UVtools.WPF/Controls/Tools/ToolLayerArithmeticControl.axaml.cs | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/UVtools.WPF/Controls/Tools/ToolLayerArithmeticControl.axaml.cs b/UVtools.WPF/Controls/Tools/ToolLayerArithmeticControl.axaml.cs new file mode 100644 index 0000000..fc07e66 --- /dev/null +++ b/UVtools.WPF/Controls/Tools/ToolLayerArithmeticControl.axaml.cs @@ -0,0 +1,40 @@ +using Avalonia.Markup.Xaml; +using UVtools.Core.Operations; +using UVtools.WPF.Windows; + +namespace UVtools.WPF.Controls.Tools +{ + public class ToolLayerArithmeticControl : ToolControl + { + public OperationLayerArithmetic Operation => BaseOperation as OperationLayerArithmetic; + + public ToolLayerArithmeticControl() + { + InitializeComponent(); + BaseOperation = new OperationLayerArithmetic(SlicerFile); + } + + private void InitializeComponent() + { + AvaloniaXamlLoader.Load(this); + } + + public override void Callback(ToolWindow.Callbacks callback) + { + switch (callback) + { + case ToolWindow.Callbacks.Init: + case ToolWindow.Callbacks.ProfileLoaded: + ParentWindow.ButtonOkEnabled = !string.IsNullOrWhiteSpace(Operation.Sentence); + Operation.PropertyChanged += (sender, e) => + { + if (e.PropertyName == nameof(Operation.Sentence)) + { + ParentWindow.ButtonOkEnabled = !string.IsNullOrWhiteSpace(Operation.Sentence); + } + }; + break; + } + } + } +} |