Added Login validation
This commit is contained in:
@@ -12,12 +12,21 @@ 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()
|
||||
@@ -38,6 +47,11 @@ public class KeyBindingTriggerBehaviour :
|
||||
|
||||
public bool CanExecute(object? parameter) => true;
|
||||
|
||||
public void Execute(object? parameter) =>
|
||||
Interaction.ExecuteActions(AssociatedObject, Actions, null);
|
||||
public void Execute(object? parameter)
|
||||
{
|
||||
if (IsEnabled)
|
||||
{
|
||||
Interaction.ExecuteActions(AssociatedObject, Actions, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user