|
1 | | -<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. --> |
| 1 | +<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. --> |
2 | 2 | <Page x:Class="CommunityToolkit.Labs.Shared.Renderers.ToolkitSampleRenderer" |
3 | 3 | xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
4 | 4 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|
21 | 21 | <VisualStateGroup x:Name="CommonStates"> |
22 | 22 | <VisualState x:Name="Normal"> |
23 | 23 | <VisualState.Setters> |
24 | | - <Setter Target="PageControl.MaxHeight" Value="400" /> |
| 24 | + <!--<Setter Target="PageControl.MaxHeight" Value="400" />--> |
25 | 25 | </VisualState.Setters> |
26 | 26 | </VisualState> |
27 | 27 | <VisualState x:Name="Tabbed"> |
28 | 28 | <VisualState.Setters> |
29 | | - <Setter Target="ToolBar.DefaultLabelPosition" Value="Right" /> |
30 | 29 | <Setter Target="CodeBtn.Visibility" Value="Collapsed" /> |
31 | | - <Setter Target="SeperatorLine.Visibility" Value="Collapsed" /> |
32 | 30 | <Setter Target="SourcecodeExpander.Visibility" Value="Collapsed" /> |
33 | 31 | <Setter Target="SampleCard.BorderThickness" Value="0" /> |
34 | 32 | <Setter Target="SampleCard.CornerRadius" Value="0" /> |
|
38 | 36 | </VisualStateGroup> |
39 | 37 |
|
40 | 38 | <VisualStateGroup x:Name="OrientationStates"> |
41 | | - <VisualState x:Name="HorizontalSampleLayout"> |
| 39 | + <VisualState x:Name="DefaultLayout"> |
42 | 40 | <VisualState.StateTriggers> |
43 | 41 | <AdaptiveTrigger MinWindowWidth="{StaticResource Breakpoint1008Plus}" /> |
44 | 42 | </VisualState.StateTriggers> |
45 | 43 | </VisualState> |
46 | | - <VisualState x:Name="VerticalSampleLayout"> |
| 44 | + <VisualState x:Name="VerticalLayout"> |
47 | 45 | <VisualState.StateTriggers> |
48 | 46 | <AdaptiveTrigger MinWindowWidth="{StaticResource Breakpoint641Plus}" /> |
49 | 47 | <AdaptiveTrigger MinWindowWidth="0" /> |
50 | 48 | </VisualState.StateTriggers> |
51 | 49 | <VisualState.Setters> |
52 | 50 | <Setter Target="OptionsPanel.(Grid.Row)" Value="1" /> |
53 | 51 | <Setter Target="OptionsPanel.(Grid.Column)" Value="0" /> |
54 | | - <Setter Target="ToolBar.(Grid.Row)" Value="1" /> |
| 52 | + <Setter Target="OptionsPanel.BorderThickness" Value="0,1,0,0" /> |
| 53 | + <Setter Target="FixedOptionsBar.BorderThickness" Value="0" /> |
55 | 54 | <Setter Target="ThemeBG.CornerRadius" Value="0" /> |
56 | 55 | <Setter Target="PageControl.Padding" Value="16,16,16,32" /> |
| 56 | + <Setter Target="ThemeBtn.(Grid.Row)" Value="0" /> |
| 57 | + <Setter Target="FlowDirectionBtn.(Grid.Row)" Value="0" /> |
| 58 | + <Setter Target="CodeBtn.(Grid.Row)" Value="0" /> |
| 59 | + <Setter Target="ThemeBtn.(Grid.Column)" Value="0" /> |
| 60 | + <Setter Target="FlowDirectionBtn.(Grid.Column)" Value="1" /> |
| 61 | + <Setter Target="CodeBtn.(Grid.Column)" Value="2" /> |
| 62 | + <Setter Target="CodePivot.Margin" Value="6,0,8,0" /> |
57 | 63 | </VisualState.Setters> |
58 | 64 | </VisualState> |
59 | 65 | </VisualStateGroup> |
|
68 | 74 | <Grid.RowDefinitions> |
69 | 75 | <RowDefinition Height="*" /> |
70 | 76 | <RowDefinition Height="Auto" /> |
| 77 | + <RowDefinition Height="Auto" /> |
71 | 78 | </Grid.RowDefinitions> |
72 | 79 | <Grid.ColumnDefinitions> |
73 | 80 | <ColumnDefinition Width="*" /> |
|
77 | 84 | <Grid x:Name="OptionsPanel" |
78 | 85 | Grid.Column="1" |
79 | 86 | VerticalAlignment="Stretch" |
80 | | - Background="{ThemeResource LayerOnAcrylicFillColorDefaultBrush}" |
| 87 | + Background="{ThemeResource LayerFillColorDefaultBrush}" |
81 | 88 | BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}" |
82 | 89 | BorderThickness="1,0,0,0"> |
83 | | - <Grid.RowDefinitions> |
84 | | - <RowDefinition Height="Auto" /> |
85 | | - <RowDefinition Height="*" /> |
86 | | - </Grid.RowDefinitions> |
87 | | - <CommandBar x:Name="ToolBar" |
88 | | - DefaultLabelPosition="Collapsed" |
89 | | - OverflowButtonVisibility="Collapsed"> |
90 | | - <!-- wasm:Visibility="Collapsed" --> |
| 90 | + <Grid.ColumnDefinitions> |
| 91 | + <ColumnDefinition Width="*" /> |
| 92 | + <ColumnDefinition Width="Auto" /> |
| 93 | + </Grid.ColumnDefinitions> |
| 94 | + |
| 95 | + <Grid x:Name="FixedOptionsBar" |
| 96 | + Grid.Column="1" |
| 97 | + HorizontalAlignment="Right" |
| 98 | + Background="{ThemeResource LayerFillColorAltBrush}" |
| 99 | + BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}" |
| 100 | + BorderThickness="1,0,0,0"> |
| 101 | + <Grid.RowDefinitions> |
| 102 | + <RowDefinition Height="Auto" /> |
| 103 | + <RowDefinition Height="*" /> |
| 104 | + <RowDefinition Height="Auto" /> |
| 105 | + </Grid.RowDefinitions> |
| 106 | + <Grid.ColumnDefinitions> |
| 107 | + <ColumnDefinition Width="Auto" /> |
| 108 | + <ColumnDefinition Width="Auto" /> |
| 109 | + <ColumnDefinition Width="Auto" /> |
| 110 | + </Grid.ColumnDefinitions> |
91 | 111 | <AppBarButton x:Name="ThemeBtn" |
| 112 | + Grid.Row="0" |
92 | 113 | Click="ThemeBtn_OnClick" |
93 | 114 | Label="Toggle theme" |
| 115 | + LabelPosition="Collapsed" |
94 | 116 | Style="{StaticResource SmallAppBarButtonStyle}" |
95 | 117 | ToolTipService.ToolTip="Toggle theme"> |
96 | 118 | <AppBarButton.Icon> |
97 | 119 | <FontIcon Glyph="" /> |
98 | 120 | </AppBarButton.Icon> |
99 | 121 | </AppBarButton> |
100 | 122 |
|
101 | | - <!-- wasm:Visibility="Collapsed" --> |
102 | 123 | <AppBarButton x:Name="FlowDirectionBtn" |
| 124 | + Grid.Row="1" |
| 125 | + wasm:Visibility="Collapsed" |
103 | 126 | Click="FlowDirectionBtn_OnClick" |
104 | 127 | Label="Toggle direction" |
| 128 | + LabelPosition="Collapsed" |
105 | 129 | Style="{StaticResource SmallAppBarButtonStyle}" |
106 | 130 | ToolTipService.ToolTip="Toggle right-to-left"> |
107 | 131 | <AppBarButton.Icon> |
108 | 132 | <FontIcon Glyph="" /> |
109 | 133 | </AppBarButton.Icon> |
110 | 134 | </AppBarButton> |
111 | | - <AppBarSeparator x:Name="SeperatorLine" /> |
| 135 | + |
112 | 136 | <AppBarButton x:Name="CodeBtn" |
| 137 | + Grid.Row="2" |
113 | 138 | Click="CodeBtn_OnClick" |
114 | 139 | Label="View code" |
| 140 | + LabelPosition="Collapsed" |
115 | 141 | Style="{StaticResource SmallAppBarButtonStyle}" |
116 | 142 | ToolTipService.ToolTip="View code"> |
117 | 143 | <AppBarButton.Icon> |
118 | 144 | <FontIcon Glyph="" /> |
119 | 145 | </AppBarButton.Icon> |
120 | 146 | </AppBarButton> |
121 | | - <!-- TO DO: What URL to link to? --> |
122 | | - <!--<AppBarButton x:Name="GitHubBtn" |
123 | | - ToolTipService.ToolTip="View sample on GitHub" |
124 | | - Visibility="Collapsed" |
125 | | - Style="{StaticResource SmallAppBarButtonStyle}"> |
126 | | - <AppBarButton.Icon> |
127 | | - <PathIcon Data="{StaticResource GithubIcon}" /> |
128 | | - </AppBarButton.Icon> |
129 | | - </AppBarButton>--> |
130 | | - </CommandBar> |
131 | | - |
132 | | - |
133 | | - <Rectangle Height="1" |
134 | | - VerticalAlignment="Bottom" |
135 | | - Fill="{ThemeResource CardStrokeColorDefaultBrush}" /> |
| 147 | + </Grid> |
136 | 148 | <ContentControl x:Name="OptionsControl" |
137 | | - Grid.Row="1" |
138 | | - MinWidth="240" |
| 149 | + Grid.Row="0" |
| 150 | + Grid.Column="0" |
| 151 | + MinWidth="256" |
139 | 152 | Margin="16" |
140 | 153 | HorizontalAlignment="Left" |
141 | 154 | Content="{x:Bind SampleOptionsPaneInstance, Mode=OneWay}" /> |
142 | 155 | </Grid> |
143 | 156 |
|
144 | | - |
145 | | - <Grid x:Name="ContentPageHolder"> |
| 157 | + <Grid x:Name="ContentPageHolder" |
| 158 | + Background="{ThemeResource CardBackgroundFillColorSecondaryBrush}"> |
146 | 159 | <!-- A solidbackground we enable when toggling themes. WinUI uses a lot of translucent brushes and might look weird --> |
147 | 160 | <Border x:Name="ThemeBG" |
148 | 161 | Background="{ThemeResource SolidBackgroundFillColorBaseBrush}" |
149 | 162 | CornerRadius="8,0,0,8" |
150 | 163 | Visibility="Collapsed" /> |
151 | 164 | <ContentControl x:Name="PageControl" |
152 | | - Grid.Row="1" |
153 | | - Padding="16,16,32,16" |
| 165 | + Padding="24,24,32,24" |
154 | 166 | HorizontalAlignment="Stretch" |
155 | 167 | VerticalAlignment="Stretch" |
156 | 168 | HorizontalContentAlignment="Stretch" |
157 | 169 | Content="{x:Bind SampleControlInstance, Mode=OneWay}" /> |
158 | 170 | </Grid> |
159 | | - </Grid> |
160 | 171 |
|
161 | | - <muxc:Expander x:Name="SourcecodeExpander" |
162 | | - Grid.Row="2" |
163 | | - MinHeight="0" |
164 | | - Margin="0,-1,0,0" |
165 | | - Padding="16,0,16,0" |
166 | | - HorizontalAlignment="Stretch" |
167 | | - BorderThickness="0"> |
168 | | - <muxc:Expander.Resources> |
169 | | - <x:Double x:Key="ExpanderChevronButtonSize">0</x:Double> |
170 | | - <Thickness x:Key="ExpanderHeaderBorderThickness">0</Thickness> |
171 | | - </muxc:Expander.Resources> |
172 | | - <Pivot MaxHeight="400" |
173 | | - HorizontalAlignment="Stretch"> |
174 | | - <Pivot.Resources> |
175 | | - <x:Double x:Key="PivotHeaderItemFontSize">14</x:Double> |
176 | | - </Pivot.Resources> |
| 172 | + <muxc:Expander x:Name="SourcecodeExpander" |
| 173 | + Grid.Row="2" |
| 174 | + Grid.ColumnSpan="3" |
| 175 | + MinHeight="0" |
| 176 | + Margin="0,-1,0,0" |
| 177 | + Padding="0,0,0,0" |
| 178 | + HorizontalAlignment="Stretch" |
| 179 | + BorderBrush="Transparent" |
| 180 | + BorderThickness="0,1,0,0" |
| 181 | + CornerRadius="0,0,8,8"> |
| 182 | + <muxc:Expander.Resources> |
| 183 | + <x:Double x:Key="ExpanderChevronButtonSize">0</x:Double> |
| 184 | + <Thickness x:Key="ExpanderHeaderBorderThickness">0,0,0,0</Thickness> |
| 185 | + <StaticResource x:Key="ExpanderContentBackground" |
| 186 | + ResourceKey="LayerFillColorDefaultBrush" /> |
| 187 | + </muxc:Expander.Resources> |
| 188 | + <Grid BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}" |
| 189 | + BorderThickness="0,1,0,0"> |
| 190 | + <Pivot x:Name="CodePivot" |
| 191 | + MaxHeight="400" |
| 192 | + Margin="16,0,16,0" |
| 193 | + HorizontalAlignment="Stretch"> |
| 194 | + <Pivot.Resources> |
| 195 | + <x:Double x:Key="PivotHeaderItemFontSize">14</x:Double> |
| 196 | + </Pivot.Resources> |
177 | 197 |
|
178 | | - <PivotItem Header="XAML"> |
179 | | - <ScrollViewer> |
180 | | - <TextBlock wasm:IsTextSelectionEnabled="True" |
181 | | - win:IsTextSelectionEnabled="True" |
182 | | - Text="{x:Bind XamlCode, Mode=OneWay}" /> |
183 | | - </ScrollViewer> |
184 | | - </PivotItem> |
185 | | - <PivotItem Header="C#"> |
186 | | - <ScrollViewer> |
187 | | - <TextBlock wasm:IsTextSelectionEnabled="True" |
188 | | - win:IsTextSelectionEnabled="True" |
189 | | - Text="{x:Bind CSharpCode, Mode=OneWay}" /> |
190 | | - </ScrollViewer> |
191 | | - </PivotItem> |
192 | | - </Pivot> |
193 | | - </muxc:Expander> |
| 198 | + <PivotItem Header="XAML"> |
| 199 | + <ScrollViewer> |
| 200 | + <TextBlock wasm:IsTextSelectionEnabled="True" |
| 201 | + win:IsTextSelectionEnabled="True" |
| 202 | + Text="{x:Bind XamlCode, Mode=OneWay}" /> |
| 203 | + </ScrollViewer> |
| 204 | + </PivotItem> |
| 205 | + <PivotItem Header="C#"> |
| 206 | + <ScrollViewer> |
| 207 | + <TextBlock wasm:IsTextSelectionEnabled="True" |
| 208 | + win:IsTextSelectionEnabled="True" |
| 209 | + Text="{x:Bind CSharpCode, Mode=OneWay}" /> |
| 210 | + </ScrollViewer> |
| 211 | + </PivotItem> |
| 212 | + </Pivot> |
| 213 | + </Grid> |
| 214 | + </muxc:Expander> |
| 215 | + </Grid> |
194 | 216 | </Grid> |
195 | 217 | </Page> |
0 commit comments