implement collapsing of child menu items.
MODIFY
WalletWasabi.Fluent/Styles/Styles.xaml
WalletWasabi.Fluent/Styles/Styles.xaml
xmlns:local="clr-namespace:AvalonStudio.Controls.Standard.CodeEditor;assembly=AvalonStudio.Controls.Standard">
<Styles.Resources>
<sys:Double x:Key="IconElementThemeHeight">16</sys:Double>
- <sys:Double x:Key="SplitViewCollapseThreshold">650</sys:Double>
+ <sys:Double x:Key="SplitViewCollapseThreshold">750</sys:Double>
</Styles.Resources>
<Style Selector="SplitView">

MODIFY
WalletWasabi.Fluent/ViewModels/ClosedWalletViewModel.cs
WalletWasabi.Fluent/ViewModels/ClosedWalletViewModel.cs
@@ -28,8 +28,6 @@ namespace WalletWasabi.Fluent.ViewModels
new HomePageViewModel(screen)
};
- IsExpanded = true;
-
OpenWalletCommand = ReactiveCommand.CreateFromTask(
async () =>
{

MODIFY
WalletWasabi.Fluent/ViewModels/NavBarViewModel.cs
WalletWasabi.Fluent/ViewModels/NavBarViewModel.cs
@@ -22,6 +22,7 @@ namespace WalletWasabi.Fluent.ViewModels
private bool _isBackButtonVisible;
private IScreen _screen;
private bool _isNavigating;
+ private bool _isOpen;
private Action _toggleAction;
private Action _collapseOnClickAction;
@@ -65,6 +66,7 @@ namespace WalletWasabi.Fluent.ViewModels
_isNavigating = true;
Router.NavigateAndReset.Execute(x);
CollapseOnClickAction?.Invoke();
+
_isNavigating = false;
}
});
@@ -109,6 +111,13 @@ namespace WalletWasabi.Fluent.ViewModels
InsertWallet(vm);
});
+ this.WhenAnyValue(x => x.IsOpen)
+ .Where(x => x == false)
+ .Subscribe(x =>
+ {
+ SelectedItem.IsExpanded = false;
+ });
+
Dispatcher.UIThread.Post(() =>
{
LoadWallets(walletManager);
@@ -158,6 +167,7 @@ namespace WalletWasabi.Fluent.ViewModels
if (_selectedItem is { })
{
_selectedItem.IsSelected = false;
+ _selectedItem.IsExpanded = false;
}
_selectedItem = null;
@@ -171,6 +181,7 @@ namespace WalletWasabi.Fluent.ViewModels
if (_selectedItem is { })
{
_selectedItem.IsSelected = true;
+ _selectedItem.IsExpanded = true;
}
}
}
@@ -182,7 +193,6 @@ namespace WalletWasabi.Fluent.ViewModels
set { this.RaiseAndSetIfChanged(ref _toggleAction, value); }
}
-
public Action CollapseOnClickAction
{
get { return _collapseOnClickAction; }
@@ -195,6 +205,12 @@ namespace WalletWasabi.Fluent.ViewModels
set => this.RaiseAndSetIfChanged(ref _isBackButtonVisible, value);
}
+ public bool IsOpen
+ {
+ get { return _isOpen; }
+ set { this.RaiseAndSetIfChanged(ref _isOpen, value); }
+ }
+
public RoutingState Router { get; }
private void LoadWallets(WalletManager walletManager)

MODIFY
WalletWasabi.Fluent/Views/MainView.axaml
WalletWasabi.Fluent/Views/MainView.axaml
xmlns:behaviors="clr-namespace:WalletWasabi.Fluent.Behaviors;assembly=WalletWasabi.Fluent"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="WalletWasabi.Fluent.Views.MainView" TextBlock.Foreground="#A3A3A3">
- <SplitView CompactPaneLength="46">
+ <SplitView CompactPaneLength="46" IsPaneOpen="{Binding NavBar.IsOpen, Mode=TwoWay}">
<i:Interaction.Behaviors>
<behaviors:SplitViewAutoBehavior ToggleAction="{Binding NavBar.ToggleAction, Mode=OneWayToSource}"
CollapseOnClickAction="{Binding NavBar.CollapseOnClickAction, Mode=OneWayToSource}"

MODIFY
WalletWasabi.Fluent/Views/MainWindow.xaml
WalletWasabi.Fluent/Views/MainWindow.xaml
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="WalletWasabi.Fluent.Views.MainWindow"
x:Name="MainWindow"
- MinWidth="525" MinHeight="380"
+ MinWidth="500" MinHeight="380"
WindowStartupLocation="CenterScreen"
Background="{x:Null}"
TransparencyLevelHint="AcrylicBlur"

implement collapsing of child menu items.