Skip to content

Commit 8ad7da6

Browse files
author
Yair Aichenbaum
committed
Settings is now responsive
1 parent 7725295 commit 8ad7da6

File tree

1 file changed

+34
-22
lines changed

1 file changed

+34
-22
lines changed

Files/Settings.xaml

Lines changed: 34 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,55 @@
22
x:Class="Files.Settings"
33
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
44
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5-
xmlns:UILib="using:Microsoft.UI.Xaml.Controls"
65
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
76
xmlns:local="using:Files"
87
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
8+
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
99
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
1010
mc:Ignorable="d">
1111

1212
<Grid>
13-
<UILib:NavigationView
13+
<muxc:NavigationView
1414
x:Name="SettingsPane"
1515
IsBackButtonVisible="Collapsed"
1616
IsSettingsVisible="False"
1717
ItemInvoked="NavigationView_ItemInvoked"
18-
PaneDisplayMode="Left">
19-
<UILib:NavigationView.MenuItems>
20-
<UILib:NavigationViewItem Content="Personalization" IsSelected="True">
21-
<UILib:NavigationViewItem.Icon>
18+
PaneDisplayMode="LeftCompact">
19+
<muxc:NavigationView.MenuItems>
20+
<muxc:NavigationViewItem Content="Personalization" IsSelected="True">
21+
<muxc:NavigationViewItem.Icon>
2222
<FontIcon Glyph="&#xE790;" />
23-
</UILib:NavigationViewItem.Icon>
24-
</UILib:NavigationViewItem>
25-
<UILib:NavigationViewItem Content="Page Layouts" Visibility="Collapsed">
26-
<UILib:NavigationViewItem.Icon>
23+
</muxc:NavigationViewItem.Icon>
24+
</muxc:NavigationViewItem>
25+
<muxc:NavigationViewItem Content="Page Layouts" Visibility="Collapsed">
26+
<muxc:NavigationViewItem.Icon>
2727
<FontIcon Glyph="&#xE737;" />
28-
</UILib:NavigationViewItem.Icon>
29-
</UILib:NavigationViewItem>
30-
<UILib:NavigationViewItem Content="Preferences">
31-
<UILib:NavigationViewItem.Icon>
28+
</muxc:NavigationViewItem.Icon>
29+
</muxc:NavigationViewItem>
30+
<muxc:NavigationViewItem Content="Preferences">
31+
<muxc:NavigationViewItem.Icon>
3232
<FontIcon Glyph="&#xE713;" />
33-
</UILib:NavigationViewItem.Icon>
34-
</UILib:NavigationViewItem>
35-
<UILib:NavigationViewItem Content="About">
36-
<UILib:NavigationViewItem.Icon>
33+
</muxc:NavigationViewItem.Icon>
34+
</muxc:NavigationViewItem>
35+
<muxc:NavigationViewItem Content="About">
36+
<muxc:NavigationViewItem.Icon>
3737
<FontIcon Glyph="&#xE946;" />
38-
</UILib:NavigationViewItem.Icon>
39-
</UILib:NavigationViewItem>
40-
</UILib:NavigationView.MenuItems>
38+
</muxc:NavigationViewItem.Icon>
39+
</muxc:NavigationViewItem>
40+
</muxc:NavigationView.MenuItems>
4141
<Frame x:Name="SettingsContentFrame" />
42-
</UILib:NavigationView>
42+
</muxc:NavigationView>
43+
<VisualStateManager.VisualStateGroups>
44+
<VisualStateGroup>
45+
<VisualState>
46+
<VisualState.StateTriggers>
47+
<AdaptiveTrigger MinWindowWidth="{x:Bind SettingsPane.CompactModeThresholdWidth}" />
48+
</VisualState.StateTriggers>
49+
<VisualState.Setters>
50+
<Setter Target="SettingsPane.PaneDisplayMode" Value="Left" />
51+
</VisualState.Setters>
52+
</VisualState>
53+
</VisualStateGroup>
54+
</VisualStateManager.VisualStateGroups>
4355
</Grid>
4456
</Page>

0 commit comments

Comments
 (0)