added Toolkit.UI.Avalonia
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Xaml.Interactivity;
|
||||
|
||||
namespace Toolkit.UI.Avalonia;
|
||||
public class ComparisonCondition :
|
||||
AvaloniaObject,
|
||||
ICondition
|
||||
{
|
||||
public static readonly StyledProperty<object> LeftOperandProperty =
|
||||
AvaloniaProperty.Register<ComparisonCondition, object>(nameof(LeftOperand));
|
||||
|
||||
public static readonly StyledProperty<ComparisonConditionType> OperatorProperty =
|
||||
AvaloniaProperty.Register<ComparisonCondition, ComparisonConditionType>(nameof(Operator));
|
||||
|
||||
public static readonly StyledProperty<object> RightOperandProperty =
|
||||
AvaloniaProperty.Register<ComparisonCondition, object>(nameof(RightOperand));
|
||||
|
||||
public object LeftOperand
|
||||
{
|
||||
get => GetValue(LeftOperandProperty);
|
||||
set => SetValue(LeftOperandProperty, value);
|
||||
}
|
||||
|
||||
public object RightOperand
|
||||
{
|
||||
get => GetValue(RightOperandProperty);
|
||||
set => SetValue(RightOperandProperty, value);
|
||||
}
|
||||
|
||||
public ComparisonConditionType Operator
|
||||
{
|
||||
get => GetValue(OperatorProperty);
|
||||
set => SetValue(OperatorProperty, value);
|
||||
}
|
||||
|
||||
public bool Evaluate() => ComparisonLogic.Evaluate(LeftOperand,
|
||||
Operator, RightOperand);
|
||||
}
|
||||
Reference in New Issue
Block a user