Refactor NavBar  commands execute to methods
MODIFY
WalletWasabi.Fluent/ViewModels/NavBar/NavBarItemViewModel.cs
WalletWasabi.Fluent/ViewModels/NavBar/NavBarItemViewModel.cs
@@ -21,18 +21,8 @@ namespace WalletWasabi.Fluent.ViewModels.NavBar
protected NavBarItemViewModel()
{
SelectionMode = NavBarItemSelectionMode.Selected;
- OpenCommand = ReactiveCommand.Create(
- () =>
- {
- if (SelectionMode == NavBarItemSelectionMode.Toggle)
- {
- Toggle();
- }
- else
- {
- Navigate().To(this, NavigationMode.Clear);
- }
- });
+
+ OpenCommand = ReactiveCommand.Create(OpenExecute);
this.WhenAnyValue(x => x.IsExpanded)
.Subscribe(x =>
@@ -44,6 +34,18 @@ namespace WalletWasabi.Fluent.ViewModels.NavBar
});
}
+ private void OpenExecute()
+ {
+ if (SelectionMode == NavBarItemSelectionMode.Toggle)
+ {
+ Toggle();
+ }
+ else
+ {
+ Navigate().To(this, NavigationMode.Clear);
+ }
+ }
+
public NavBarItemViewModel? Parent { get; set; }
public NavBarItemSelectionMode SelectionMode { get; protected set; }

Refactor NavBar  commands execute to methods