mirror of
https://github.com/riegera2412/UVtools.git
synced 2026-07-20 07:26:26 +02:00
- (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
42 lines
1.3 KiB
C#
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;
|
|
}
|
|
}
|
|
}
|
|
}
|