namespace Avalonia.Xaml.Interactivity;
///
/// A base class for action that calls a method on a specified object when invoked.
///
public abstract class Action : AvaloniaObject, IAction
{
///
/// Identifies the avalonia property.
///
public static readonly StyledProperty IsEnabledProperty =
AvaloniaProperty.Register(nameof(IsEnabled), defaultValue: true);
///
/// Gets or sets a value indicating whether this instance is enabled.
///
/// true if this instance is enabled; otherwise, false.
public bool IsEnabled
{
get => GetValue(IsEnabledProperty);
set => SetValue(IsEnabledProperty, value);
}
///
/// Executes the action.
///
/// The that is passed to the action by the behavior. Generally this is or a target object.
/// The value of this parameter is determined by the caller.
/// An example of parameter usage is EventTriggerBehavior, which passes the EventArgs as a parameter to its actions.
/// Returns the result of the action.
public abstract object? Execute(object? sender, object? parameter);
}