Reselect item when actions are shown or removed
MODIFY
WalletWasabi.Fluent/ViewModels/NavBar/NavBarViewModel.cs
WalletWasabi.Fluent/ViewModels/NavBar/NavBarViewModel.cs
@@ -203,7 +203,11 @@ namespace WalletWasabi.Fluent.ViewModels.NavBar
{
_isNavigating = true;
- walletManager.SelectionChanged(x);
+ var result = walletManager.SelectionChanged(x);
+ if (result is not null)
+ {
+ SelectedItem = x;
+ }
if (x.SelectionMode == NavBarItemSelectionMode.Selected)
{
@@ -220,13 +224,18 @@ namespace WalletWasabi.Fluent.ViewModels.NavBar
if (!_isNavigating)
{
_isNavigating = true;
+
+ var result = _walletManager.SelectionChanged(x);
+ if (result is not null)
+ {
+ SelectedItem = result;
+ }
+
if (x.OpenCommand.CanExecute(default))
{
x.OpenCommand.Execute(default);
}
- _walletManager.SelectionChanged(x);
-
CollapseOnClickAction?.Invoke();
_isNavigating = false;
}

MODIFY
WalletWasabi.Fluent/ViewModels/WalletManagerViewModel.cs
WalletWasabi.Fluent/ViewModels/WalletManagerViewModel.cs
@@ -144,11 +144,13 @@ namespace WalletWasabi.Fluent.ViewModels
}
}
- public void SelectionChanged(NavBarItemViewModel item)
+ public NavBarItemViewModel? SelectionChanged(NavBarItemViewModel item)
{
+ var result = default(NavBarItemViewModel);
+
if (SelectedWallet == item)
{
- return;
+ return result;
}
if (SelectedWallet is { IsLoggedIn: true } walletViewModelPrevious /* && item is WalletViewModelBase { IsLoggedIn: true } */)
@@ -160,6 +162,8 @@ namespace WalletWasabi.Fluent.ViewModels
RemoveActions(walletViewModelPrevious, actions);
SelectedWallet = null;
+
+ result = item;
}
}
@@ -174,7 +178,11 @@ namespace WalletWasabi.Fluent.ViewModels
InsertActions(walletViewModelItem, actions);
SelectedWallet = walletViewModelItem;
+
+ result = item;
}
+
+ return result;
}
private List<WalletActionViewModel> GetWalletActions(WalletViewModelBase walletViewModel)

Reselect item when actions are shown or removed