|
9 | 9 | // |
10 | 10 | //********************************************************* |
11 | 11 | --> |
12 | | - |
13 | 12 | <Page |
14 | 13 | x:Class="AppUIBasics.ControlPages.AccessibilityColorContrastPage" |
15 | 14 | xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|
38 | 37 | <RichTextBlock> |
39 | 38 | <Paragraph> |
40 | 39 | Accessibility is about building experiences that make your Windows application usable by people of |
41 | | - all abilities. For more information about designing accessible apps: <Hyperlink NavigateUri="https://learn.microsoft.com/windows/apps/design/accessibility/accessibility-overview">Accessibility overview</Hyperlink> |
42 | | - .<LineBreak /> |
| 40 | + all abilities. For more information about designing accessible apps: |
| 41 | + <Hyperlink NavigateUri="https://learn.microsoft.com/windows/apps/design/accessibility/accessibility-overview">Accessibility overview</Hyperlink> |
| 42 | + . |
| 43 | + <LineBreak /> |
43 | 44 | <LineBreak /> |
44 | 45 | To ensure optimal accessibility and usability, apps should strive to use high-contrast and easy-to- |
45 | 46 | read color combinationto for text and its background. Not only will this benefit users with lower |
46 | 47 | visual acuity, but this will also ensure visibility and legibility under a wide range of lighting |
47 | | - conditions, screens, and device settings.<LineBreak /> |
| 48 | + conditions, screens, and device settings. |
48 | 49 | <LineBreak /> |
49 | | - Check out the <Hyperlink NavigateUri="https://accessibilityinsights.io/">Accessibility Insights</Hyperlink> |
50 | | - app to help you find and fix accessibility issues in your Windows apps.</Paragraph> |
51 | | - |
| 50 | + <LineBreak /> |
| 51 | + Check out the |
| 52 | + <Hyperlink NavigateUri="https://accessibilityinsights.io/">Accessibility Insights</Hyperlink> |
| 53 | + app to help you find and fix accessibility issues in your Windows apps. |
| 54 | + </Paragraph> |
52 | 55 | </RichTextBlock> |
53 | 56 |
|
54 | 57 | <TextBlock |
|
60 | 63 | Style="{ThemeResource BodyTextBlockStyle}" |
61 | 64 | Text="Use this tool to calculate the contrast ratio of two colors and measure them against the Web Content Accessibility Guidelines (WCAG)." |
62 | 65 | TextWrapping="Wrap" /> |
63 | | - <Grid |
64 | | - Padding="8" |
65 | | - Background="{ThemeResource CardBackgroundFillColorDefaultBrush}" |
66 | | - ColumnSpacing="8" |
67 | | - CornerRadius="{StaticResource ControlCornerRadius}" |
68 | | - RowSpacing="8"> |
69 | | - <Grid.RowDefinitions> |
70 | | - <RowDefinition Height="Auto" /> |
71 | | - <RowDefinition Height="Auto" /> |
72 | | - <RowDefinition Height="Auto" /> |
73 | | - </Grid.RowDefinitions> |
74 | | - <Grid.ColumnDefinitions> |
75 | | - <ColumnDefinition Width="Auto" /> |
76 | | - <ColumnDefinition Width="Auto" /> |
77 | | - <ColumnDefinition Width="Auto" /> |
78 | | - <ColumnDefinition Width="*" /> |
79 | | - </Grid.ColumnDefinitions> |
| 66 | + <controls1:SampleThemeListener> |
| 67 | + <Grid |
| 68 | + Padding="8" |
| 69 | + Background="{ThemeResource ControlExampleDisplayBrush}" |
| 70 | + BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}" |
| 71 | + BorderThickness="1" |
| 72 | + CornerRadius="{StaticResource ControlCornerRadius}" |
| 73 | + ColumnSpacing="8" |
| 74 | + RowSpacing="8"> |
| 75 | + <Grid.RowDefinitions> |
| 76 | + <RowDefinition Height="Auto" /> |
| 77 | + <RowDefinition Height="Auto" /> |
| 78 | + <RowDefinition Height="Auto" /> |
| 79 | + </Grid.RowDefinitions> |
| 80 | + <Grid.ColumnDefinitions> |
| 81 | + <ColumnDefinition Width="Auto" /> |
| 82 | + <ColumnDefinition Width="Auto" /> |
| 83 | + <ColumnDefinition Width="Auto" /> |
| 84 | + <ColumnDefinition Width="*" /> |
| 85 | + </Grid.ColumnDefinitions> |
80 | 86 |
|
81 | | - <controls1:InlineColorPicker |
| 87 | + <controls1:InlineColorPicker |
82 | 88 | x:Name="TextColorPicker" |
83 | 89 | AutomationProperties.Name="TextColorPicker" |
84 | 90 | Grid.RowSpan="2" |
85 | 91 | Header="Text Color" |
86 | 92 | ColorChanged="TextColorPicker_ColorChanged" |
87 | 93 | Color="Black" /> |
88 | 94 |
|
89 | | - <controls1:InlineColorPicker |
| 95 | + <controls1:InlineColorPicker |
90 | 96 | x:Name="BackgroundColorPicker" |
91 | 97 | AutomationProperties.Name="BackgroundColorPicker" |
92 | 98 | Grid.Column="1" |
93 | 99 | Grid.RowSpan="2" |
94 | 100 | Header="Background Color" |
95 | 101 | ColorChanged="BackgroundColorPicker_ColorChanged" /> |
96 | 102 |
|
97 | | - <TextBlock |
| 103 | + <TextBlock |
98 | 104 | Grid.Column="3" |
99 | 105 | Margin="12,0,0,0" |
100 | 106 | VerticalAlignment="Center" |
101 | 107 | Style="{ThemeResource BodyStrongTextBlockStyle}" |
102 | 108 | Text="Contrast Ratio" /> |
103 | | - <TextBlock |
| 109 | + <TextBlock |
104 | 110 | x:Name="ContrastRatioPresenter" |
105 | 111 | Grid.Row="1" |
106 | 112 | Grid.Column="3" |
107 | 113 | Margin="12,-4,0,0" |
108 | 114 | Style="{ThemeResource SubtitleTextBlockStyle}" |
109 | 115 | Text="21:1" /> |
110 | 116 |
|
111 | | - <Grid |
| 117 | + <Grid |
112 | 118 | Grid.Row="2" |
113 | 119 | Grid.ColumnSpan="4" |
114 | 120 | MinHeight="300" |
115 | 121 | Margin="12,0,12,12" |
116 | 122 | CornerRadius="{StaticResource ControlCornerRadius}"> |
117 | | - <Grid.ColumnDefinitions> |
118 | | - <ColumnDefinition Width="*" /> |
119 | | - <ColumnDefinition Width="*" /> |
120 | | - </Grid.ColumnDefinitions> |
| 123 | + <Grid.ColumnDefinitions> |
| 124 | + <ColumnDefinition Width="*" /> |
| 125 | + <ColumnDefinition Width="*" /> |
| 126 | + </Grid.ColumnDefinitions> |
121 | 127 |
|
122 | | - <!-- Status Checks --> |
123 | | - <Grid |
| 128 | + <!-- Status Checks --> |
| 129 | + <Grid |
124 | 130 | Padding="8" |
125 | 131 | Background="{ThemeResource ControlFillColorDefaultBrush}" |
126 | 132 | ColumnSpacing="8" |
127 | 133 | RowSpacing="16"> |
128 | | - <Grid.RowDefinitions> |
129 | | - <RowDefinition Height="*" /> |
130 | | - <RowDefinition Height="*" /> |
131 | | - <RowDefinition Height="*" /> |
132 | | - </Grid.RowDefinitions> |
| 134 | + <Grid.RowDefinitions> |
| 135 | + <RowDefinition Height="*" /> |
| 136 | + <RowDefinition Height="*" /> |
| 137 | + <RowDefinition Height="*" /> |
| 138 | + </Grid.RowDefinitions> |
133 | 139 |
|
134 | | - <Grid.ColumnDefinitions> |
135 | | - <ColumnDefinition Width="Auto" /> |
136 | | - <ColumnDefinition Width="Auto" /> |
137 | | - <ColumnDefinition Width="*" /> |
138 | | - </Grid.ColumnDefinitions> |
| 140 | + <Grid.ColumnDefinitions> |
| 141 | + <ColumnDefinition Width="Auto" /> |
| 142 | + <ColumnDefinition Width="Auto" /> |
| 143 | + <ColumnDefinition Width="*" /> |
| 144 | + </Grid.ColumnDefinitions> |
139 | 145 |
|
140 | | - <Grid Margin="12,0,0,0"> |
141 | | - <Ellipse |
| 146 | + <Grid Margin="12,0,0,0"> |
| 147 | + <Ellipse |
142 | 148 | x:Name="NormalTextCheckEllipse" |
143 | 149 | Width="30" |
144 | 150 | Height="30" |
145 | 151 | Fill="{ThemeResource SystemFillColorSuccess}" /> |
146 | | - <FontIcon |
| 152 | + <FontIcon |
147 | 153 | x:Name="NormalTextCheckIcon" |
148 | 154 | Foreground="White" |
149 | 155 | Glyph="" /> |
150 | | - </Grid> |
151 | | - <TextBlock |
| 156 | + </Grid> |
| 157 | + <TextBlock |
152 | 158 | x:Name="NormalTextCheckResult" |
153 | 159 | Grid.Column="1" |
154 | 160 | Width="40" |
155 | 161 | VerticalAlignment="Center" |
156 | 162 | Style="{ThemeResource BodyStrongTextBlockStyle}" |
157 | 163 | Text="Pass" /> |
158 | | - <StackPanel |
| 164 | + <StackPanel |
159 | 165 | Grid.Column="2" |
160 | 166 | Padding="0,0,12,0" |
161 | 167 | VerticalAlignment="Center"> |
162 | | - <TextBlock FontWeight="Bold" Text="Regular text" /> |
163 | | - <TextBlock Text="Requires at least 4.5:1" /> |
164 | | - </StackPanel> |
| 168 | + <TextBlock FontWeight="Bold" Text="Regular text" /> |
| 169 | + <TextBlock Text="Requires at least 4.5:1" /> |
| 170 | + </StackPanel> |
165 | 171 |
|
166 | | - <Grid Grid.Row="1" Margin="12,0,0,0"> |
167 | | - <Ellipse |
| 172 | + <Grid Grid.Row="1" Margin="12,0,0,0"> |
| 173 | + <Ellipse |
168 | 174 | x:Name="LargeTextCheckEllipse" |
169 | 175 | Width="30" |
170 | 176 | Height="30" |
171 | 177 | Fill="{ThemeResource SystemFillColorSuccess}" /> |
172 | | - <FontIcon |
| 178 | + <FontIcon |
173 | 179 | x:Name="LargeTextCheckIcon" |
174 | 180 | Foreground="White" |
175 | 181 | Glyph="" /> |
176 | | - </Grid> |
177 | | - <TextBlock |
| 182 | + </Grid> |
| 183 | + <TextBlock |
178 | 184 | x:Name="LargeTextCheckResult" |
179 | 185 | Grid.Row="1" |
180 | 186 | Grid.Column="1" |
181 | 187 | Width="40" |
182 | 188 | VerticalAlignment="Center" |
183 | 189 | Style="{ThemeResource BodyStrongTextBlockStyle}" |
184 | 190 | Text="Pass" /> |
185 | | - <StackPanel |
| 191 | + <StackPanel |
186 | 192 | Grid.Row="1" |
187 | 193 | Grid.Column="2" |
188 | 194 | Padding="0,0,12,0" |
189 | 195 | VerticalAlignment="Center"> |
190 | | - <TextBlock FontWeight="Bold" Text="Large text (14 pt. bold or 18pt. regular)" /> |
191 | | - <TextBlock Text="Requires at least 3:1" /> |
192 | | - </StackPanel> |
| 196 | + <TextBlock FontWeight="Bold" Text="Large text (14 pt. bold or 18pt. regular)" /> |
| 197 | + <TextBlock Text="Requires at least 3:1" /> |
| 198 | + </StackPanel> |
193 | 199 |
|
194 | | - <Grid Grid.Row="2" Margin="10,0,0,0"> |
195 | | - <Ellipse |
| 200 | + <Grid Grid.Row="2" Margin="10,0,0,0"> |
| 201 | + <Ellipse |
196 | 202 | x:Name="ComponentsCheckEllipse" |
197 | 203 | Width="30" |
198 | 204 | Height="30" |
199 | 205 | VerticalAlignment="Center" |
200 | 206 | Fill="{ThemeResource SystemFillColorSuccess}" /> |
201 | | - <FontIcon |
| 207 | + <FontIcon |
202 | 208 | x:Name="ComponentsCheckIcon" |
203 | 209 | Foreground="White" |
204 | 210 | Glyph="" /> |
205 | | - </Grid> |
206 | | - <TextBlock |
| 211 | + </Grid> |
| 212 | + <TextBlock |
207 | 213 | x:Name="ComponentsCheckResult" |
208 | 214 | Grid.Row="2" |
209 | 215 | Grid.Column="1" |
210 | 216 | Width="40" |
211 | 217 | VerticalAlignment="Center" |
212 | 218 | Style="{ThemeResource BodyStrongTextBlockStyle}" |
213 | 219 | Text="Pass" /> |
214 | | - <StackPanel |
| 220 | + <StackPanel |
215 | 221 | Grid.Row="2" |
216 | 222 | Grid.Column="2" |
217 | 223 | Padding="0,0,10,0" |
218 | 224 | VerticalAlignment="Center"> |
219 | | - <TextBlock FontWeight="Bold" Text="Graphical objects and UI components" /> |
220 | | - <TextBlock Text="Requires at least 3:1" /> |
221 | | - </StackPanel> |
222 | | - </Grid> |
| 225 | + <TextBlock FontWeight="Bold" Text="Graphical objects and UI components" /> |
| 226 | + <TextBlock Text="Requires at least 3:1" /> |
| 227 | + </StackPanel> |
| 228 | + </Grid> |
223 | 229 |
|
224 | | - <!-- Preview --> |
225 | | - <Grid |
| 230 | + <!-- Preview --> |
| 231 | + <Grid |
226 | 232 | Grid.Column="1" |
227 | 233 | Padding="8" |
228 | 234 | Background="{x:Bind BackgroundColorPicker.ColorBrush, Mode=OneWay}"> |
229 | | - <Grid.RowDefinitions> |
230 | | - <RowDefinition Height="*" /> |
231 | | - <RowDefinition Height="*" /> |
232 | | - <RowDefinition Height="*" /> |
233 | | - </Grid.RowDefinitions> |
| 235 | + <Grid.RowDefinitions> |
| 236 | + <RowDefinition Height="*" /> |
| 237 | + <RowDefinition Height="*" /> |
| 238 | + <RowDefinition Height="*" /> |
| 239 | + </Grid.RowDefinitions> |
234 | 240 |
|
235 | | - <TextBlock |
| 241 | + <TextBlock |
236 | 242 | Padding="12,0,12,0" |
237 | 243 | VerticalAlignment="Center" |
238 | 244 | Foreground="{x:Bind TextColorPicker.ColorBrush, Mode=OneWay}" |
239 | 245 | Text="The quick brown fox jumped over the lazy fox." /> |
240 | 246 |
|
241 | | - <StackPanel |
| 247 | + <StackPanel |
242 | 248 | Grid.Row="1" |
243 | 249 | Padding="12,0,12,0" |
244 | 250 | VerticalAlignment="Center"> |
245 | | - <TextBlock |
| 251 | + <TextBlock |
246 | 252 | FontSize="14" |
247 | 253 | FontWeight="Bold" |
248 | 254 | Foreground="{x:Bind TextColorPicker.ColorBrush, Mode=OneWay}" |
249 | 255 | Text="The quick brown fox jumped over the lazy fox." /> |
250 | | - <TextBlock |
| 256 | + <TextBlock |
251 | 257 | FontSize="18" |
252 | 258 | Foreground="{x:Bind TextColorPicker.ColorBrush, Mode=OneWay}" |
253 | 259 | Text="The quick brown fox jumped over the lazy fox." /> |
254 | | - </StackPanel> |
| 260 | + </StackPanel> |
255 | 261 |
|
256 | | - <StackPanel |
| 262 | + <StackPanel |
257 | 263 | Grid.Row="2" |
258 | 264 | Padding="12,0,12,0" |
259 | 265 | VerticalAlignment="Center" |
260 | 266 | Orientation="Horizontal" |
261 | 267 | Spacing="8"> |
262 | | - <Grid> |
263 | | - <Rectangle |
| 268 | + <Grid> |
| 269 | + <Rectangle |
264 | 270 | Width="30" |
265 | 271 | Height="30" |
266 | 272 | Fill="{x:Bind TextColorPicker.ColorBrush, Mode=OneWay}" |
267 | 273 | RadiusX="4" |
268 | 274 | RadiusY="4" /> |
269 | | - <FontIcon Foreground="White" Glyph="" /> |
270 | | - </Grid> |
| 275 | + <FontIcon Foreground="White" Glyph="" /> |
| 276 | + </Grid> |
271 | 277 |
|
272 | | - <Grid> |
273 | | - <Rectangle |
| 278 | + <Grid> |
| 279 | + <Rectangle |
274 | 280 | Width="50" |
275 | 281 | Height="30" |
276 | 282 | Fill="{x:Bind TextColorPicker.ColorBrush, Mode=OneWay}" |
277 | 283 | RadiusX="15" |
278 | 284 | RadiusY="50" /> |
279 | | - <Ellipse |
| 285 | + <Ellipse |
280 | 286 | Width="15" |
281 | 287 | Height="15" |
282 | 288 | Margin="0,0,5,0" |
283 | 289 | HorizontalAlignment="Right" |
284 | 290 | VerticalAlignment="Center" |
285 | 291 | Fill="White" /> |
286 | | - </Grid> |
287 | | - <FontIcon |
| 292 | + </Grid> |
| 293 | + <FontIcon |
288 | 294 | FontSize="20" |
289 | 295 | Foreground="{x:Bind TextColorPicker.ColorBrush, Mode=OneWay}" |
290 | 296 | Glyph="" /> |
291 | | - </StackPanel> |
| 297 | + </StackPanel> |
| 298 | + </Grid> |
292 | 299 | </Grid> |
293 | 300 | </Grid> |
294 | | - </Grid> |
| 301 | + </controls1:SampleThemeListener> |
295 | 302 | </StackPanel> |
296 | 303 | </Page> |
0 commit comments