Added IsEnabled property to FocusOnAttachedBehavior
MODIFY
WalletWasabi.Fluent/Behaviors/FocusOnAttachedBehavior.cs
WalletWasabi.Fluent/Behaviors/FocusOnAttachedBehavior.cs
+using Avalonia;
using Avalonia.Controls;
namespace WalletWasabi.Fluent.Behaviors
{
public class FocusOnAttachedBehavior : AttachedToVisualTreeBehavior<Control>
{
+ public static readonly StyledProperty<bool> IsEnabledProperty =
+ AvaloniaProperty.Register<FocusOnAttachedBehavior, bool>(nameof(IsEnabled), true);
+
+ public bool IsEnabled
+ {
+ get => GetValue(IsEnabledProperty);
+ set => SetValue(IsEnabledProperty, value);
+ }
+
protected override void OnAttachedToVisualTree()
+ {
+ if (IsEnabled)
{
AssociatedObject?.Focus();
}
}
}
+}
\ No newline at end of file

Added IsEnabled property to FocusOnAttachedBehavior