Added Select method
MODIFY
WalletWasabi.Fluent/ViewModels/NavBar/NavBarViewModel.cs
WalletWasabi.Fluent/ViewModels/NavBar/NavBarViewModel.cs
@@ -123,9 +123,7 @@ namespace WalletWasabi.Fluent.ViewModels.NavBar
this.RaisePropertyChanged(nameof(SelectedItem));
}
- private void SetSelectedItem(NavBarItemViewModel? value)
- {
- if (value is null || value.Mode == NavBarItemSelectionMode.Selected)
+ private void Select(NavBarItemViewModel? value)
{
if (_selectedItem == value)
{
@@ -159,15 +157,24 @@ namespace WalletWasabi.Fluent.ViewModels.NavBar
}
}
- if (value is not null && value.Mode == NavBarItemSelectionMode.Button)
+ private void SetSelectedItem(NavBarItemViewModel? value)
+ {
+ if (value is null || value.Mode == NavBarItemSelectionMode.Selected)
+ {
+ Select(value);
+ return;
+ }
+
+ if (value.Mode == NavBarItemSelectionMode.Button)
{
_isNavigating = true;
RaiseAndChangeSelectedItem(_selectedItem);
_isNavigating = false;
NavigateItem(value);
+ return;
}
- if (value is not null && value.Mode == NavBarItemSelectionMode.Toggle)
+ if (value.Mode == NavBarItemSelectionMode.Toggle)
{
_isNavigating = true;
RaiseAndChangeSelectedItem(_selectedItem);

Added Select method