Add ReSelectSelectedItem property
MODIFY
WalletWasabi.Fluent/Controls/NavBarListBox.cs
WalletWasabi.Fluent/Controls/NavBarListBox.cs
@@ -9,6 +9,15 @@ namespace WalletWasabi.Fluent.Controls
{
public class NavBarListBox : ListBox, IStyleable
{
+ public static readonly StyledProperty<bool> ReSelectSelectedItemProperty =
+ AvaloniaProperty.Register<NavBarListBox, bool>(nameof(ReSelectSelectedItem), true);
+
+ public bool ReSelectSelectedItem
+ {
+ get => GetValue(ReSelectSelectedItemProperty);
+ set => SetValue(ReSelectSelectedItemProperty, value);
+ }
+
Type IStyleable.StyleKey => typeof(ListBox);
protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)
@@ -41,6 +50,8 @@ namespace WalletWasabi.Fluent.Controls
// Console.WriteLine($"AFTER OnPointerPressed {SelectedItem?.GetType().Name}");
+ if (ReSelectSelectedItem)
+ {
var isSameSelectedItem = previousSelectedItem is not null && previousSelectedItem == SelectedItem;
Console.WriteLine($"OnPointerPressed {isSameSelectedItem}");
if (isSameSelectedItem)
@@ -52,3 +63,4 @@ namespace WalletWasabi.Fluent.Controls
}
}
}
+}

Add ReSelectSelectedItem property