|
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="ColorAnalyzerExperiment.Samples.ContrastHelperSample" |
3 | 3 | xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
4 | 4 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|
12 | 12 |
|
13 | 13 | <Grid> |
14 | 14 | <Grid.RowDefinitions> |
15 | | - <RowDefinition/> |
16 | | - <RowDefinition Height="auto"/> |
| 15 | + <RowDefinition /> |
| 16 | + <RowDefinition Height="auto" /> |
17 | 17 | </Grid.RowDefinitions> |
18 | 18 |
|
19 | 19 | <Grid.ColumnDefinitions> |
20 | | - <ColumnDefinition/> |
21 | | - <ColumnDefinition/> |
| 20 | + <ColumnDefinition /> |
| 21 | + <ColumnDefinition /> |
22 | 22 | </Grid.ColumnDefinitions> |
23 | 23 |
|
24 | 24 | <Border Grid.ColumnSpan="2"> |
25 | 25 | <Border.Background> |
26 | | - <SolidColorBrush Color="{x:Bind BackgroundPicker.Color, Mode=OneWay}"/> |
| 26 | + <SolidColorBrush Color="{x:Bind BackgroundPicker.Color, Mode=OneWay}" /> |
27 | 27 | </Border.Background> |
28 | 28 | <StackPanel Spacing="2"> |
29 | | - <TextBlock Text="Always legible text" |
30 | | - FontSize="24" |
31 | | - helpers:ContrastHelper.Opponent="{x:Bind BackgroundPicker.Color, Mode=OneWay}"/> |
32 | | - <TextBlock Text="Legible text (MinRatio: 5)" |
| 29 | + <TextBlock helpers:ContrastHelper.Opponent="{x:Bind BackgroundPicker.Color, Mode=OneWay}" |
33 | 30 | FontSize="24" |
| 31 | + Text="Always legible text" /> |
| 32 | + <TextBlock helpers:ContrastHelper.MinRatio="5" |
34 | 33 | helpers:ContrastHelper.Opponent="{x:Bind BackgroundPicker.Color, Mode=OneWay}" |
35 | | - helpers:ContrastHelper.MinRatio="5"> |
| 34 | + FontSize="24" |
| 35 | + Text="Legible text (MinRatio: 5)"> |
36 | 36 | <TextBlock.Foreground> |
37 | | - <SolidColorBrush Color="{x:Bind ForegroundPicker.Color, Mode=OneWay}"/> |
| 37 | + <SolidColorBrush Color="{x:Bind ForegroundPicker.Color, Mode=OneWay}" /> |
38 | 38 | </TextBlock.Foreground> |
39 | 39 | </TextBlock> |
40 | | - <TextBlock Text="Legible text (MinRatio: 3)" |
41 | | - FontSize="16" |
| 40 | + <TextBlock helpers:ContrastHelper.MinRatio="3" |
42 | 41 | helpers:ContrastHelper.Opponent="{x:Bind BackgroundPicker.Color, Mode=OneWay}" |
43 | | - helpers:ContrastHelper.MinRatio="3"> |
| 42 | + FontSize="16" |
| 43 | + Text="Legible text (MinRatio: 3)"> |
44 | 44 | <TextBlock.Foreground> |
45 | | - <SolidColorBrush Color="{x:Bind ForegroundPicker.Color, Mode=OneWay}"/> |
| 45 | + <SolidColorBrush Color="{x:Bind ForegroundPicker.Color, Mode=OneWay}" /> |
46 | 46 | </TextBlock.Foreground> |
47 | 47 | </TextBlock> |
48 | | - <TextBlock Text="Potentially illegible text" |
49 | | - FontSize="16"> |
| 48 | + <TextBlock FontSize="16" |
| 49 | + Text="Potentially illegible text"> |
50 | 50 | <TextBlock.Foreground> |
51 | | - <SolidColorBrush Color="{x:Bind ForegroundPicker.Color, Mode=OneWay}"/> |
| 51 | + <SolidColorBrush Color="{x:Bind ForegroundPicker.Color, Mode=OneWay}" /> |
52 | 52 | </TextBlock.Foreground> |
53 | 53 | </TextBlock> |
54 | 54 | </StackPanel> |
55 | 55 | </Border> |
56 | 56 |
|
57 | 57 | <StackPanel Grid.Row="1" |
58 | 58 | HorizontalAlignment="Center"> |
59 | | - <TextBlock Text="Foreground"/> |
| 59 | + <TextBlock Text="Foreground" /> |
60 | 60 | <ColorPicker x:Name="ForegroundPicker" |
61 | | - Color="Black" |
| 61 | + IsColorChannelTextInputVisible="False" |
62 | 62 | IsHexInputVisible="False" |
63 | | - IsColorChannelTextInputVisible="False"/> |
| 63 | + Color="Black" /> |
64 | 64 | </StackPanel> |
65 | 65 |
|
66 | | - <StackPanel Grid.Column="1" |
67 | | - Grid.Row="1" |
| 66 | + <StackPanel Grid.Row="1" |
| 67 | + Grid.Column="1" |
68 | 68 | HorizontalAlignment="Center"> |
69 | | - <TextBlock Text="Backround"/> |
| 69 | + <TextBlock Text="Backround" /> |
70 | 70 | <ColorPicker x:Name="BackgroundPicker" |
71 | | - IsHexInputVisible="False" |
72 | | - IsColorChannelTextInputVisible="False"/> |
| 71 | + IsColorChannelTextInputVisible="False" |
| 72 | + IsHexInputVisible="False" /> |
73 | 73 | </StackPanel> |
74 | 74 | </Grid> |
75 | 75 | </Page> |
0 commit comments