[NavBar] auto collapse and expand takes into account parent child relationship.
MODIFY
WalletWasabi.Fluent/ViewModels/ClosedWalletViewModel.cs
WalletWasabi.Fluent/ViewModels/ClosedWalletViewModel.cs
@@ -19,7 +19,7 @@ namespace WalletWasabi.Fluent.ViewModels
{
_items = new ObservableCollection<NavBarItemViewModel>
{
- new HomePageViewModel(screen)
+ new HomePageViewModel(screen){ Parent = this }
};
OpenWalletCommand = ReactiveCommand.CreateFromTask(

MODIFY
WalletWasabi.Fluent/ViewModels/NavBarItemViewModel.cs
WalletWasabi.Fluent/ViewModels/NavBarItemViewModel.cs
@@ -14,6 +14,8 @@ namespace WalletWasabi.Fluent.ViewModels
HostScreen = screen;
}
+ public NavBarItemViewModel Parent { get; set; }
+
public abstract string IconName { get; }
public string UrlPathSegment { get; } = Guid.NewGuid().ToString().Substring(0, 5);

MODIFY
WalletWasabi.Fluent/ViewModels/NavBarViewModel.cs
WalletWasabi.Fluent/ViewModels/NavBarViewModel.cs
@@ -167,6 +167,12 @@ namespace WalletWasabi.Fluent.ViewModels
{
_selectedItem.IsSelected = false;
_selectedItem.IsExpanded = false;
+
+ if (_selectedItem.Parent is { })
+ {
+ _selectedItem.Parent.IsSelected = false;
+ _selectedItem.Parent.IsExpanded = false;
+ }
}
_selectedItem = null;
@@ -181,6 +187,12 @@ namespace WalletWasabi.Fluent.ViewModels
{
_selectedItem.IsSelected = true;
_selectedItem.IsExpanded = IsOpen;
+
+ if (_selectedItem.Parent is { })
+ {
+ _selectedItem.Parent.IsSelected = true;
+ _selectedItem.Parent.IsExpanded = true;
+ }
}
}
}

[NavBar] auto collapse and expand takes into account parent child relationship.