Added an EventListenerBehaviour for listening for events raised from the source

This commit is contained in:
TheXamlGuy
2024-09-29 15:01:02 +01:00
parent 4b732791bd
commit 379d43d553
3 changed files with 135 additions and 10 deletions
@@ -12,21 +12,12 @@ public class KeyBindingTriggerBehaviour :
public static readonly StyledProperty<KeyGesture> GestureProperty =
AvaloniaProperty.Register<KeyBindingTriggerBehaviour, KeyGesture>(nameof(Gesture));
public static readonly StyledProperty<bool> IsEnabledProperty =
AvaloniaProperty.Register<KeyBindingTriggerBehaviour, bool>(nameof(IsEnabled), true);
public KeyGesture Gesture
{
get => GetValue(GestureProperty);
set => SetValue(GestureProperty, value);
}
public bool IsEnabled
{
get => GetValue(IsEnabledProperty);
set => SetValue(IsEnabledProperty, value);
}
public event EventHandler? CanExecuteChanged;
protected override void OnAttached()