-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
52c2a83
commit ca91842
Showing
10 changed files
with
81 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
namespace Avalonia.Xaml.Interactivity; | ||
|
||
/// <summary> | ||
/// A base class for action that calls a method on a specified object when invoked. | ||
/// </summary> | ||
public abstract class ActionBase : AvaloniaObject, IAction | ||
{ | ||
/// <summary> | ||
/// Identifies the <seealso cref="IsEnabled"/> avalonia property. | ||
/// </summary> | ||
public static readonly StyledProperty<bool> IsEnabledProperty = | ||
AvaloniaProperty.Register<ActionBase, bool>(nameof(IsEnabled), defaultValue: true); | ||
|
||
/// <summary> | ||
/// Gets or sets a value indicating whether this instance is enabled. | ||
/// </summary> | ||
/// <value><c>true</c> if this instance is enabled; otherwise, <c>false</c>.</value> | ||
public bool IsEnabled | ||
{ | ||
get => GetValue(IsEnabledProperty); | ||
set => SetValue(IsEnabledProperty, value); | ||
} | ||
|
||
/// <summary> | ||
/// Executes the action. | ||
/// </summary> | ||
/// <param name="sender">The <see cref="object"/> that is passed to the action by the behavior. Generally this is <seealso cref="IBehavior.AssociatedObject"/> or a target object.</param> | ||
/// <param name="parameter">The value of this parameter is determined by the caller.</param> | ||
/// <remarks> An example of parameter usage is EventTriggerBehavior, which passes the EventArgs as a parameter to its actions.</remarks> | ||
/// <returns>Returns the result of the action.</returns> | ||
public abstract object? Execute(object? sender, object? parameter); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters