Files
UVtools/UVtools.WPF/Controls/Tools/ToolLayerArithmeticControl.axaml.cs
T
Tiago Conceição 2af14924a1 Improvements to corrode and apply methods
- (Add) Apply to - Model surface: Apply only to model surface/visible pixels
   - (Add) Apply to - Model surface & inset: Apply only to model surface/visible pixels and within a inset from walls
   - (Improvement) Speed up the Corrode apply method
2021-10-02 22:38:11 +01:00

42 lines
1.3 KiB
C#

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()
{
BaseOperation = new OperationLayerArithmetic(SlicerFile);
if (!ValidateSpawn()) return;
InitializeComponent();
}
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
public override void Callback(ToolWindow.Callbacks callback)
{
switch (callback)
{
case ToolWindow.Callbacks.Init:
case ToolWindow.Callbacks.Loaded:
if(ParentWindow is not null) ParentWindow.ButtonOkEnabled = !string.IsNullOrWhiteSpace(Operation.Sentence);
Operation.PropertyChanged += (sender, e) =>
{
if (e.PropertyName == nameof(Operation.Sentence))
{
ParentWindow.ButtonOkEnabled = !string.IsNullOrWhiteSpace(Operation.Sentence);
}
};
break;
}
}
}
}