make expansion persist if set by user.
MODIFY
WalletWasabi.Fluent/Behaviors/SplitViewAutoBehavior.cs
WalletWasabi.Fluent/Behaviors/SplitViewAutoBehavior.cs
@@ -42,8 +42,14 @@ namespace WalletWasabi.Fluent.Behaviors
.DistinctUntilChanged()
.Subscribe(SplitViewBoundsChanged));
+ Disposables.Add(this.GetObservable(IsExpandedProperty).Subscribe(OnIsExpandedChanged));
+
base.OnAttached();
}
+ private void OnIsExpandedChanged(bool x)
+ {
+ AssociatedObject.IsPaneOpen = x;
+ }
private void SplitViewBoundsChanged(Rect x)
{
@@ -56,7 +62,7 @@ namespace WalletWasabi.Fluent.Behaviors
{
AssociatedObject.DisplayMode = SplitViewDisplayMode.CompactOverlay;
- if (AssociatedObject.IsPaneOpen)
+ if (AssociatedObject.IsPaneOpen & !IsExpanded)
{
AssociatedObject.IsPaneOpen = false;
}
@@ -64,6 +70,11 @@ namespace WalletWasabi.Fluent.Behaviors
else
{
AssociatedObject.DisplayMode = SplitViewDisplayMode.CompactInline;
+
+ if (!AssociatedObject.IsPaneOpen & !IsExpanded)
+ {
+ AssociatedObject.IsPaneOpen = true;
+ }
}
}

MODIFY
WalletWasabi.Fluent/Views/MainView.axaml
WalletWasabi.Fluent/Views/MainView.axaml
x:Class="WalletWasabi.Fluent.Views.MainView" TextBlock.Foreground="#A3A3A3">
<SplitView>
<i:Interaction.Behaviors>
- <behaviors:SplitViewAutoBehavior IsExpanded="{Binding $parent[SplitView].DataContext.NavBar.IsExpanded}" CollapseThreshold="{StaticResource SplitViewCollapseThreshold}"/>
+ <behaviors:SplitViewAutoBehavior IsExpanded="{Binding NavBar.IsExpanded, Mode=TwoWay}" CollapseThreshold="{StaticResource SplitViewCollapseThreshold}"/>
</i:Interaction.Behaviors>
<SplitView.Pane>
<Panel>

MODIFY
WalletWasabi.Fluent/Views/NavBar.axaml
WalletWasabi.Fluent/Views/NavBar.axaml
<DockPanel Margin="1">
<StackPanel DockPanel.Dock="Top" Margin="0 0 0 0">
<StackPanel Orientation="Horizontal" Spacing="5">
- <ToggleButton Classes="NavButton" IsChecked="{Binding $parent[behaviors:SplitViewAutoBehavior].IsExpanded}">
+ <ToggleButton Classes="NavButton" IsChecked="{Binding IsExpanded}">
<PathIcon Data="{StaticResource navigation_regular}" />
</ToggleButton>
<TextBlock Text="Wasabi Wallet" FontWeight="Bold" Foreground="White" VerticalAlignment="Center"/>

make expansion persist if set by user.