|
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 | | -<local:ColorPaletteSamplerToolkitSampleBase |
3 | | - x:Class="ColorAnalyzerExperiment.Samples.AccentColorSample" |
4 | | - xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
5 | | - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
6 | | - xmlns:behaviors="using:CommunityToolkit.WinUI.Behaviors" |
7 | | - xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
8 | | - xmlns:helpers="using:CommunityToolkit.WinUI.Helpers" |
9 | | - xmlns:interactivity="using:Microsoft.Xaml.Interactivity" |
10 | | - xmlns:local="using:ColorAnalyzerExperiment.Samples" |
11 | | - xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
12 | | - mc:Ignorable="d"> |
| 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 | +<local:ColorPaletteSamplerToolkitSampleBase x:Class="ColorAnalyzerExperiment.Samples.AccentColorSample" |
| 3 | + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 4 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 5 | + xmlns:behaviors="using:CommunityToolkit.WinUI.Behaviors" |
| 6 | + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
| 7 | + xmlns:helpers="using:CommunityToolkit.WinUI.Helpers" |
| 8 | + xmlns:interactivity="using:Microsoft.Xaml.Interactivity" |
| 9 | + xmlns:local="using:ColorAnalyzerExperiment.Samples" |
| 10 | + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
| 11 | + mc:Ignorable="d"> |
13 | 12 |
|
14 | 13 | <local:ColorPaletteSamplerToolkitSampleBase.Resources> |
15 | 14 | <helpers:ColorPaletteSampler x:Name="ColorPaletteSampler"> |
16 | 15 | <helpers:ColorPaletteSampler.Source> |
17 | | - <!--<helpers:UIColorSource Source="{x:Bind SampledImage}" />--> |
18 | | - <helpers:UrlColorSource Source="{x:Bind SelectedImageUrl, Mode=OneWay}" /> |
| 16 | + <helpers:UIColorSource Source="{x:Bind SampledImage}" /> |
19 | 17 | </helpers:ColorPaletteSampler.Source> |
20 | | - <helpers:AccentColorPaletteSelector x:Name="AccentPalette" MinColorCount="3" /> |
| 18 | + <helpers:AccentColorPaletteSelector x:Name="AccentPalette" |
| 19 | + MinColorCount="3" /> |
21 | 20 | </helpers:ColorPaletteSampler> |
22 | 21 | </local:ColorPaletteSamplerToolkitSampleBase.Resources> |
23 | 22 |
|
|
32 | 31 | <ColumnDefinition Width="*" /> |
33 | 32 | </Grid.ColumnDefinitions> |
34 | 33 |
|
35 | | - <Grid Margin="20" VerticalAlignment="Center"> |
36 | | - <Image |
37 | | - x:Name="SampledImage" |
38 | | - HorizontalAlignment="Center" |
39 | | - Source="{x:Bind SelectedImage, Mode=OneWay}" |
40 | | - Stretch="Uniform"> |
| 34 | + <Grid Margin="20" |
| 35 | + VerticalAlignment="Center"> |
| 36 | + <Image x:Name="SampledImage" |
| 37 | + HorizontalAlignment="Center" |
| 38 | + Source="{x:Bind SelectedImage, Mode=OneWay}" |
| 39 | + Stretch="Uniform"> |
41 | 40 | <interactivity:Interaction.Behaviors> |
42 | 41 | <interactivity:EventTriggerBehavior EventName="ImageOpened"> |
43 | | - <interactivity:CallMethodAction MethodName="UpdatePalette" TargetObject="{x:Bind ColorPaletteSampler}" /> |
| 42 | + <interactivity:CallMethodAction MethodName="UpdatePalette" |
| 43 | + TargetObject="{x:Bind ColorPaletteSampler}" /> |
44 | 44 | </interactivity:EventTriggerBehavior> |
45 | 45 | </interactivity:Interaction.Behaviors> |
46 | 46 | </Image> |
47 | 47 | </Grid> |
48 | 48 |
|
49 | | - <Grid |
50 | | - Grid.Column="1" |
51 | | - MaxWidth="400" |
52 | | - MaxHeight="250" |
53 | | - Margin="20" |
54 | | - HorizontalAlignment="Stretch" |
55 | | - VerticalAlignment="Stretch"> |
| 49 | + <Grid Grid.Column="1" |
| 50 | + MaxWidth="400" |
| 51 | + MaxHeight="250" |
| 52 | + Margin="20" |
| 53 | + HorizontalAlignment="Stretch" |
| 54 | + VerticalAlignment="Stretch"> |
56 | 55 | <Grid.ColumnDefinitions> |
57 | 56 | <ColumnDefinition /> |
58 | 57 | <ColumnDefinition /> |
|
64 | 63 | </Grid.RowDefinitions> |
65 | 64 |
|
66 | 65 | <!-- Primary Accent Color --> |
67 | | - <Border |
68 | | - Grid.ColumnSpan="2" |
69 | | - Margin="4" |
70 | | - Padding="2"> |
| 66 | + <Border Grid.ColumnSpan="2" |
| 67 | + Margin="4" |
| 68 | + Padding="2"> |
71 | 69 | <Border.Background> |
72 | 70 | <SolidColorBrush Color="{x:Bind AccentPalette.SelectedColors[0], FallbackValue=Transparent, Mode=OneWay}" /> |
73 | 71 | </Border.Background> |
74 | | - <TextBlock helpers:ContrastHelper.Opponent="{x:Bind AccentPalette.SelectedColors[0], FallbackValue=Transparent, Mode=OneWay}" Text="Primary Accent" /> |
| 72 | + <TextBlock helpers:ContrastHelper.Opponent="{x:Bind AccentPalette.SelectedColors[0], FallbackValue=Transparent, Mode=OneWay}" |
| 73 | + Text="Primary Accent" /> |
75 | 74 | </Border> |
76 | 75 |
|
77 | 76 | <!-- Secondary Accent Color --> |
78 | | - <Border |
79 | | - Grid.Row="1" |
80 | | - Margin="4" |
81 | | - Padding="2"> |
| 77 | + <Border Grid.Row="1" |
| 78 | + Margin="4" |
| 79 | + Padding="2"> |
82 | 80 | <Border.Background> |
83 | 81 | <SolidColorBrush Color="{x:Bind AccentPalette.SelectedColors[1], FallbackValue=Transparent, Mode=OneWay}" /> |
84 | 82 | </Border.Background> |
85 | | - <TextBlock helpers:ContrastHelper.Opponent="{x:Bind AccentPalette.SelectedColors[1], FallbackValue=Transparent, Mode=OneWay}" Text="Secondary Accent" /> |
| 83 | + <TextBlock helpers:ContrastHelper.Opponent="{x:Bind AccentPalette.SelectedColors[1], FallbackValue=Transparent, Mode=OneWay}" |
| 84 | + Text="Secondary Accent" /> |
86 | 85 | </Border> |
87 | 86 |
|
88 | 87 | <!-- Tertiary Accent Color --> |
89 | | - <Border |
90 | | - Grid.Row="1" |
91 | | - Grid.Column="1" |
92 | | - Margin="4" |
93 | | - Padding="2"> |
| 88 | + <Border Grid.Row="1" |
| 89 | + Grid.Column="1" |
| 90 | + Margin="4" |
| 91 | + Padding="2"> |
94 | 92 | <Border.Background> |
95 | 93 | <SolidColorBrush Color="{x:Bind AccentPalette.SelectedColors[2], FallbackValue=Transparent, Mode=OneWay}" /> |
96 | 94 | </Border.Background> |
97 | | - <TextBlock helpers:ContrastHelper.Opponent="{x:Bind AccentPalette.SelectedColors[2], FallbackValue=Transparent, Mode=OneWay}" Text="Tertiary Accent" /> |
| 95 | + <TextBlock helpers:ContrastHelper.Opponent="{x:Bind AccentPalette.SelectedColors[2], FallbackValue=Transparent, Mode=OneWay}" |
| 96 | + Text="Tertiary Accent" /> |
98 | 97 | </Border> |
99 | 98 |
|
100 | 99 | <!-- Accent Colors Gradient --> |
101 | | - <Rectangle |
102 | | - Grid.Row="3" |
103 | | - Grid.ColumnSpan="2" |
104 | | - Margin="4"> |
| 100 | + <Rectangle Grid.Row="3" |
| 101 | + Grid.ColumnSpan="2" |
| 102 | + Margin="4"> |
105 | 103 | <Rectangle.Fill> |
106 | 104 | <LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5"> |
107 | 105 | <GradientStopCollection> |
|
0 commit comments