Skip to content

Commit e4fcd6c

Browse files
committed
Apply XAML styling
1 parent 8817e06 commit e4fcd6c

4 files changed

Lines changed: 189 additions & 194 deletions

File tree

components/ColorAnalyzer/samples/ColorPaletteSampler/AccentColorSample.xaml

Lines changed: 47 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
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">
1312

1413
<local:ColorPaletteSamplerToolkitSampleBase.Resources>
1514
<helpers:ColorPaletteSampler x:Name="ColorPaletteSampler">
1615
<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}" />
1917
</helpers:ColorPaletteSampler.Source>
20-
<helpers:AccentColorPaletteSelector x:Name="AccentPalette" MinColorCount="3" />
18+
<helpers:AccentColorPaletteSelector x:Name="AccentPalette"
19+
MinColorCount="3" />
2120
</helpers:ColorPaletteSampler>
2221
</local:ColorPaletteSamplerToolkitSampleBase.Resources>
2322

@@ -32,27 +31,27 @@
3231
<ColumnDefinition Width="*" />
3332
</Grid.ColumnDefinitions>
3433

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">
4140
<interactivity:Interaction.Behaviors>
4241
<interactivity:EventTriggerBehavior EventName="ImageOpened">
43-
<interactivity:CallMethodAction MethodName="UpdatePalette" TargetObject="{x:Bind ColorPaletteSampler}" />
42+
<interactivity:CallMethodAction MethodName="UpdatePalette"
43+
TargetObject="{x:Bind ColorPaletteSampler}" />
4444
</interactivity:EventTriggerBehavior>
4545
</interactivity:Interaction.Behaviors>
4646
</Image>
4747
</Grid>
4848

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">
5655
<Grid.ColumnDefinitions>
5756
<ColumnDefinition />
5857
<ColumnDefinition />
@@ -64,44 +63,43 @@
6463
</Grid.RowDefinitions>
6564

6665
<!-- 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">
7169
<Border.Background>
7270
<SolidColorBrush Color="{x:Bind AccentPalette.SelectedColors[0], FallbackValue=Transparent, Mode=OneWay}" />
7371
</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" />
7574
</Border>
7675

7776
<!-- 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">
8280
<Border.Background>
8381
<SolidColorBrush Color="{x:Bind AccentPalette.SelectedColors[1], FallbackValue=Transparent, Mode=OneWay}" />
8482
</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" />
8685
</Border>
8786

8887
<!-- 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">
9492
<Border.Background>
9593
<SolidColorBrush Color="{x:Bind AccentPalette.SelectedColors[2], FallbackValue=Transparent, Mode=OneWay}" />
9694
</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" />
9897
</Border>
9998

10099
<!-- 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">
105103
<Rectangle.Fill>
106104
<LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5">
107105
<GradientStopCollection>

components/ColorAnalyzer/samples/ColorPaletteSampler/BaseColorSample.xaml

Lines changed: 47 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
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.BaseColorSample"
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.BaseColorSample"
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">
1312

1413
<local:ColorPaletteSamplerToolkitSampleBase.Resources>
1514
<helpers:ColorPaletteSampler x:Name="ColorPaletteSampler">
1615
<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}" />
1917
</helpers:ColorPaletteSampler.Source>
20-
<helpers:BaseColorPaletteSelector x:Name="BaseColorPalette" MinColorCount="3" />
18+
<helpers:BaseColorPaletteSelector x:Name="BaseColorPalette"
19+
MinColorCount="3" />
2120
</helpers:ColorPaletteSampler>
2221
</local:ColorPaletteSamplerToolkitSampleBase.Resources>
2322

@@ -32,27 +31,27 @@
3231
<ColumnDefinition Width="*" />
3332
</Grid.ColumnDefinitions>
3433

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">
4140
<interactivity:Interaction.Behaviors>
4241
<interactivity:EventTriggerBehavior EventName="ImageOpened">
43-
<interactivity:CallMethodAction MethodName="UpdatePalette" TargetObject="{x:Bind ColorPaletteSampler}" />
42+
<interactivity:CallMethodAction MethodName="UpdatePalette"
43+
TargetObject="{x:Bind ColorPaletteSampler}" />
4444
</interactivity:EventTriggerBehavior>
4545
</interactivity:Interaction.Behaviors>
4646
</Image>
4747
</Grid>
4848

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">
5655
<Grid.ColumnDefinitions>
5756
<ColumnDefinition />
5857
<ColumnDefinition />
@@ -64,44 +63,43 @@
6463
</Grid.RowDefinitions>
6564

6665
<!-- Most Basic Color -->
67-
<Border
68-
Grid.ColumnSpan="2"
69-
Margin="4"
70-
Padding="2">
66+
<Border Grid.ColumnSpan="2"
67+
Margin="4"
68+
Padding="2">
7169
<Border.Background>
7270
<SolidColorBrush Color="{x:Bind BaseColorPalette.SelectedColors[0], FallbackValue=Transparent, Mode=OneWay}" />
7371
</Border.Background>
74-
<TextBlock helpers:ContrastHelper.Opponent="{x:Bind BaseColorPalette.SelectedColors[0], FallbackValue=Transparent, Mode=OneWay}" Text="Base" />
72+
<TextBlock helpers:ContrastHelper.Opponent="{x:Bind BaseColorPalette.SelectedColors[0], FallbackValue=Transparent, Mode=OneWay}"
73+
Text="Base" />
7574
</Border>
7675

7776
<!-- Second Most Basic Color -->
78-
<Border
79-
Grid.Row="1"
80-
Margin="4"
81-
Padding="2">
77+
<Border Grid.Row="1"
78+
Margin="4"
79+
Padding="2">
8280
<Border.Background>
8381
<SolidColorBrush Color="{x:Bind BaseColorPalette.SelectedColors[1], FallbackValue=Transparent, Mode=OneWay}" />
8482
</Border.Background>
85-
<TextBlock helpers:ContrastHelper.Opponent="{x:Bind BaseColorPalette.SelectedColors[1], FallbackValue=Transparent, Mode=OneWay}" Text="Base 2" />
83+
<TextBlock helpers:ContrastHelper.Opponent="{x:Bind BaseColorPalette.SelectedColors[1], FallbackValue=Transparent, Mode=OneWay}"
84+
Text="Base 2" />
8685
</Border>
8786

8887
<!-- Third Most Basic 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">
9492
<Border.Background>
9593
<SolidColorBrush Color="{x:Bind BaseColorPalette.SelectedColors[2], FallbackValue=Transparent, Mode=OneWay}" />
9694
</Border.Background>
97-
<TextBlock helpers:ContrastHelper.Opponent="{x:Bind BaseColorPalette.SelectedColors[2], FallbackValue=Transparent, Mode=OneWay}" Text="Base 3" />
95+
<TextBlock helpers:ContrastHelper.Opponent="{x:Bind BaseColorPalette.SelectedColors[2], FallbackValue=Transparent, Mode=OneWay}"
96+
Text="Base 3" />
9897
</Border>
9998

10099
<!-- 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">
105103
<Rectangle.Fill>
106104
<LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5">
107105
<GradientStopCollection>

0 commit comments

Comments
 (0)