|
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="600" /> |
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 | | - <Setter Target="PageControl.Padding" Value="16,16,16,32" /> |
| 55 | + <Setter Target="ThemeBtn.(Grid.Row)" Value="0" /> |
| 56 | + <Setter Target="FlowDirectionBtn.(Grid.Row)" Value="0" /> |
| 57 | + <Setter Target="CodeBtn.(Grid.Row)" Value="0" /> |
| 58 | + <Setter Target="ThemeBtn.(Grid.Column)" Value="0" /> |
| 59 | + <Setter Target="FlowDirectionBtn.(Grid.Column)" Value="1" /> |
| 60 | + <Setter Target="CodeBtn.(Grid.Column)" Value="2" /> |
| 61 | + <Setter Target="CodePivot.Margin" Value="6,0,8,0" /> |
| 62 | + <Setter Target="FixedOptionsBar.ColumnSpacing" Value="8" /> |
| 63 | + <Setter Target="FixedOptionsBar.RowSpacing" Value="0" /> |
| 64 | + <Setter Target="FixedOptionsBar.Margin" Value="12" /> |
| 65 | + |
57 | 66 | </VisualState.Setters> |
58 | 67 | </VisualState> |
59 | 68 | </VisualStateGroup> |
|
68 | 77 | <Grid.RowDefinitions> |
69 | 78 | <RowDefinition Height="*" /> |
70 | 79 | <RowDefinition Height="Auto" /> |
| 80 | + <RowDefinition Height="Auto" /> |
71 | 81 | </Grid.RowDefinitions> |
72 | 82 | <Grid.ColumnDefinitions> |
73 | 83 | <ColumnDefinition Width="*" /> |
|
77 | 87 | <Grid x:Name="OptionsPanel" |
78 | 88 | Grid.Column="1" |
79 | 89 | VerticalAlignment="Stretch" |
80 | | - Background="{ThemeResource LayerOnAcrylicFillColorDefaultBrush}" |
| 90 | + Background="{ThemeResource LayerFillColorDefaultBrush}" |
81 | 91 | BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}" |
82 | 92 | 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" --> |
91 | | - <AppBarButton x:Name="ThemeBtn" |
92 | | - Click="ThemeBtn_OnClick" |
93 | | - Label="Toggle theme" |
94 | | - Style="{StaticResource SmallAppBarButtonStyle}" |
95 | | - ToolTipService.ToolTip="Toggle theme"> |
96 | | - <AppBarButton.Icon> |
97 | | - <FontIcon Glyph="" /> |
98 | | - </AppBarButton.Icon> |
99 | | - </AppBarButton> |
| 93 | + <Grid.ColumnDefinitions> |
| 94 | + <ColumnDefinition Width="*" /> |
| 95 | + <ColumnDefinition Width="Auto" /> |
| 96 | + </Grid.ColumnDefinitions> |
| 97 | + <ScrollViewer x:Name="OptionsScrollViewer" |
| 98 | + Grid.Row="0" |
| 99 | + Grid.Column="0" |
| 100 | + MinWidth="256" |
| 101 | + Padding="16"> |
| 102 | + <ContentControl x:Name="OptionsControl" |
| 103 | + Content="{x:Bind SampleOptionsPaneInstance, Mode=OneWay}" /> |
| 104 | + </ScrollViewer> |
| 105 | + <Grid x:Name="FixedOptionsBar" |
| 106 | + Grid.Column="1" |
| 107 | + Padding="4" |
| 108 | + HorizontalAlignment="Right" |
| 109 | + Background="{ThemeResource LayerFillColorAltBrush}" |
| 110 | + BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}" |
| 111 | + BorderThickness="1,0,0,0" |
| 112 | + RowSpacing="8"> |
| 113 | + <Grid.RowDefinitions> |
| 114 | + <RowDefinition Height="Auto" /> |
| 115 | + <RowDefinition Height="*" /> |
| 116 | + <RowDefinition Height="Auto" /> |
| 117 | + </Grid.RowDefinitions> |
| 118 | + <Grid.ColumnDefinitions> |
| 119 | + <ColumnDefinition Width="Auto" /> |
| 120 | + <ColumnDefinition Width="Auto" /> |
| 121 | + <ColumnDefinition Width="Auto" /> |
| 122 | + </Grid.ColumnDefinitions> |
| 123 | + <Button x:Name="ThemeBtn" |
| 124 | + Grid.Row="0" |
| 125 | + Width="32" |
| 126 | + Height="32" |
| 127 | + Padding="4" |
| 128 | + HorizontalAlignment="Center" |
| 129 | + Click="ThemeBtn_OnClick" |
| 130 | + Style="{StaticResource SubtleButtonStyle}" |
| 131 | + ToolTipService.ToolTip="Toggle theme"> |
| 132 | + <Button.Content> |
| 133 | + <FontIcon FontSize="16" |
| 134 | + Glyph="" /> |
| 135 | + </Button.Content> |
| 136 | + </Button> |
100 | 137 |
|
101 | | - <!-- wasm:Visibility="Collapsed" --> |
102 | | - <AppBarButton x:Name="FlowDirectionBtn" |
103 | | - Click="FlowDirectionBtn_OnClick" |
104 | | - Label="Toggle direction" |
105 | | - Style="{StaticResource SmallAppBarButtonStyle}" |
106 | | - ToolTipService.ToolTip="Toggle right-to-left"> |
107 | | - <AppBarButton.Icon> |
108 | | - <FontIcon Glyph="" /> |
109 | | - </AppBarButton.Icon> |
110 | | - </AppBarButton> |
111 | | - <AppBarSeparator x:Name="SeperatorLine" /> |
112 | | - <AppBarButton x:Name="CodeBtn" |
113 | | - Click="CodeBtn_OnClick" |
114 | | - Label="View code" |
115 | | - Style="{StaticResource SmallAppBarButtonStyle}" |
116 | | - ToolTipService.ToolTip="View code"> |
117 | | - <AppBarButton.Icon> |
118 | | - <FontIcon Glyph="" /> |
119 | | - </AppBarButton.Icon> |
120 | | - </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> |
| 138 | + <Button x:Name="FlowDirectionBtn" |
| 139 | + Grid.Row="1" |
| 140 | + Width="32" |
| 141 | + Height="32" |
| 142 | + Padding="4" |
| 143 | + HorizontalAlignment="Center" |
| 144 | + VerticalAlignment="Top" |
| 145 | + wasm:Visibility="Collapsed" |
| 146 | + Click="FlowDirectionBtn_OnClick" |
| 147 | + Style="{StaticResource SubtleButtonStyle}" |
| 148 | + ToolTipService.ToolTip="Toggle right-to-left"> |
131 | 149 |
|
| 150 | + <Button.Content> |
| 151 | + <FontIcon FontSize="16" |
| 152 | + Glyph="" /> |
| 153 | + </Button.Content> |
| 154 | + </Button> |
132 | 155 |
|
133 | | - <Rectangle Height="1" |
134 | | - VerticalAlignment="Bottom" |
135 | | - Fill="{ThemeResource CardStrokeColorDefaultBrush}" /> |
136 | | - <ContentControl x:Name="OptionsControl" |
137 | | - Grid.Row="1" |
138 | | - MinWidth="240" |
139 | | - Margin="16" |
140 | | - HorizontalAlignment="Left" |
141 | | - Content="{x:Bind SampleOptionsPaneInstance, Mode=OneWay}" /> |
142 | | - </Grid> |
| 156 | + <Button x:Name="CodeBtn" |
| 157 | + Grid.Row="2" |
| 158 | + Width="32" |
| 159 | + Height="32" |
| 160 | + Padding="4" |
| 161 | + HorizontalAlignment="Center" |
| 162 | + Click="CodeBtn_OnClick" |
| 163 | + Style="{StaticResource AccentButtonStyle}" |
| 164 | + ToolTipService.ToolTip="View code"> |
| 165 | + <Button.Content> |
| 166 | + <FontIcon FontSize="14" |
| 167 | + Glyph="" /> |
| 168 | + </Button.Content> |
| 169 | + </Button> |
| 170 | + </Grid> |
143 | 171 |
|
| 172 | + </Grid> |
144 | 173 |
|
145 | | - <Grid x:Name="ContentPageHolder"> |
| 174 | + <Grid x:Name="ContentPageHolder" |
| 175 | + Background="{ThemeResource CardBackgroundFillColorSecondaryBrush}"> |
146 | 176 | <!-- A solidbackground we enable when toggling themes. WinUI uses a lot of translucent brushes and might look weird --> |
147 | 177 | <Border x:Name="ThemeBG" |
148 | 178 | Background="{ThemeResource SolidBackgroundFillColorBaseBrush}" |
149 | 179 | CornerRadius="8,0,0,8" |
150 | 180 | Visibility="Collapsed" /> |
151 | | - <ContentControl x:Name="PageControl" |
152 | | - Grid.Row="1" |
153 | | - Padding="16,16,32,16" |
154 | | - HorizontalAlignment="Stretch" |
155 | | - VerticalAlignment="Stretch" |
156 | | - HorizontalContentAlignment="Stretch" |
157 | | - Content="{x:Bind SampleControlInstance, Mode=OneWay}" /> |
| 181 | + <ScrollViewer HorizontalAlignment="Stretch" |
| 182 | + VerticalAlignment="Stretch" |
| 183 | + HorizontalContentAlignment="Stretch"> |
| 184 | + |
| 185 | + <ContentControl x:Name="PageControl" |
| 186 | + Margin="16" |
| 187 | + HorizontalAlignment="Stretch" |
| 188 | + VerticalAlignment="Stretch" |
| 189 | + HorizontalContentAlignment="Stretch" |
| 190 | + Background="Yellow" |
| 191 | + Content="{x:Bind SampleControlInstance, Mode=OneWay}" /> |
| 192 | + </ScrollViewer> |
158 | 193 | </Grid> |
159 | | - </Grid> |
160 | 194 |
|
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> |
| 195 | + <muxc:Expander x:Name="SourcecodeExpander" |
| 196 | + Grid.Row="2" |
| 197 | + Grid.ColumnSpan="3" |
| 198 | + MinHeight="0" |
| 199 | + Margin="0,-1,0,0" |
| 200 | + Padding="0,0,0,0" |
| 201 | + HorizontalAlignment="Stretch" |
| 202 | + BorderBrush="Transparent" |
| 203 | + BorderThickness="0,1,0,0" |
| 204 | + CornerRadius="0,0,8,8"> |
| 205 | + <muxc:Expander.Resources> |
| 206 | + <x:Double x:Key="ExpanderChevronButtonSize">0</x:Double> |
| 207 | + <Thickness x:Key="ExpanderHeaderBorderThickness">0,0,0,0</Thickness> |
| 208 | + <StaticResource x:Key="ExpanderContentBackground" |
| 209 | + ResourceKey="LayerFillColorDefaultBrush" /> |
| 210 | + </muxc:Expander.Resources> |
| 211 | + <Grid BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}" |
| 212 | + BorderThickness="0,1,0,0"> |
| 213 | + <Pivot x:Name="CodePivot" |
| 214 | + MaxHeight="400" |
| 215 | + Margin="16,0,16,0" |
| 216 | + HorizontalAlignment="Stretch"> |
| 217 | + <Pivot.Resources> |
| 218 | + <x:Double x:Key="PivotHeaderItemFontSize">14</x:Double> |
| 219 | + </Pivot.Resources> |
177 | 220 |
|
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> |
| 221 | + <PivotItem Header="XAML"> |
| 222 | + <ScrollViewer> |
| 223 | + <TextBlock wasm:IsTextSelectionEnabled="True" |
| 224 | + win:IsTextSelectionEnabled="True" |
| 225 | + Style="{StaticResource CaptionTextBlockStyle}" |
| 226 | + Text="{x:Bind XamlCode, Mode=OneWay}" /> |
| 227 | + </ScrollViewer> |
| 228 | + </PivotItem> |
| 229 | + <PivotItem Header="C#"> |
| 230 | + <ScrollViewer> |
| 231 | + <TextBlock wasm:IsTextSelectionEnabled="True" |
| 232 | + win:IsTextSelectionEnabled="True" |
| 233 | + Style="{StaticResource CaptionTextBlockStyle}" |
| 234 | + Text="{x:Bind CSharpCode, Mode=OneWay}" /> |
| 235 | + </ScrollViewer> |
| 236 | + </PivotItem> |
| 237 | + </Pivot> |
| 238 | + </Grid> |
| 239 | + </muxc:Expander> |
| 240 | + </Grid> |
194 | 241 | </Grid> |
195 | 242 | </Page> |
0 commit comments