Skip to content

Commit f1188cb

Browse files
committed
Applied xaml styles
1 parent adb79b4 commit f1188cb

File tree

2 files changed

+76
-56
lines changed

2 files changed

+76
-56
lines changed

components/AccentAnalyzer/samples/AccentAnalyzerSample.xaml

Lines changed: 64 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
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. -->
22
<Page x:Class="AccentAnalyzerExperiment.Samples.AccentAnalyzerSample"
33
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
44
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5-
xmlns:extensions="using:CommunityToolkit.WinUI.Extensions"
5+
xmlns:behaviors="using:CommunityToolkit.WinUI.Behaviors"
66
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
7+
xmlns:extensions="using:CommunityToolkit.WinUI.Extensions"
8+
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
79
xmlns:local="using:AccentAnalyzerExperiment.Samples"
810
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
9-
xmlns:behaviors="using:CommunityToolkit.WinUI.Behaviors"
10-
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
1111
mc:Ignorable="d">
1212

1313
<Page.Resources>
14-
<extensions:AccentAnalyzer x:Name="AccentAnalyzer" Source="{x:Bind AccentedImage}"/>
14+
<extensions:AccentAnalyzer x:Name="AccentAnalyzer"
15+
Source="{x:Bind AccentedImage}" />
1516
</Page.Resources>
16-
17+
1718
<Grid>
1819
<Grid.ColumnDefinitions>
1920
<ColumnDefinition Width="*" />
@@ -22,75 +23,92 @@
2223

2324
<StackPanel VerticalAlignment="Center">
2425
<Image x:Name="AccentedImage"
25-
Source="/Helpers.AccentAnalyzerExperiment.Samples/Assets/icon.png"
26-
Stretch="UniformToFill"
27-
HorizontalAlignment="Center"
2826
Width="200"
2927
Height="200"
30-
Margin="20">
28+
Margin="20"
29+
HorizontalAlignment="Center"
30+
Source="/Helpers.AccentAnalyzerExperiment.Samples/Assets/icon.png"
31+
Stretch="UniformToFill">
3132
<interactivity:Interaction.Behaviors>
3233
<interactivity:EventTriggerBehavior EventName="ImageOpened">
33-
<interactivity:InvokeCommandAction Command="{x:Bind AccentAnalyzer.AccentUpdateCommand}"/>
34+
<interactivity:InvokeCommandAction Command="{x:Bind AccentAnalyzer.AccentUpdateCommand}" />
3435
</interactivity:EventTriggerBehavior>
3536
</interactivity:Interaction.Behaviors>
3637
</Image>
37-
<TextBlock Text="{x:Bind AccentAnalyzer.Colorfulness, Mode=OneWay}"
38-
HorizontalAlignment="Center"/>
38+
<TextBlock HorizontalAlignment="Center"
39+
Text="{x:Bind AccentAnalyzer.Colorfulness, Mode=OneWay}" />
3940
</StackPanel>
4041

41-
<Grid Grid.Column="1" Height="400" Width="400">
42+
<Grid Grid.Column="1"
43+
Width="400"
44+
Height="400">
4245
<Grid.ColumnDefinitions>
43-
<ColumnDefinition/>
44-
<ColumnDefinition/>
46+
<ColumnDefinition />
47+
<ColumnDefinition />
4548
</Grid.ColumnDefinitions>
4649
<Grid.RowDefinitions>
47-
<RowDefinition Height="4*"/>
48-
<RowDefinition Height="2*"/>
49-
<RowDefinition Height="*"/>
50-
<RowDefinition Height="*"/>
50+
<RowDefinition Height="4*" />
51+
<RowDefinition Height="2*" />
52+
<RowDefinition Height="*" />
53+
<RowDefinition Height="*" />
5154
</Grid.RowDefinitions>
5255

53-
<!--Dominant-->
54-
<Border Grid.Column="0" Grid.RowSpan="3"
55-
Margin="4" Padding="2">
56+
<!-- Dominant -->
57+
<Border Grid.RowSpan="3"
58+
Grid.Column="0"
59+
Margin="4"
60+
Padding="2">
5661
<Border.Background>
57-
<SolidColorBrush Color="{x:Bind AccentAnalyzer.DominantColor, Mode=OneWay}"/>
62+
<SolidColorBrush Color="{x:Bind AccentAnalyzer.DominantColor, Mode=OneWay}" />
5863
</Border.Background>
59-
<TextBlock Text="Dominant" Foreground="Black"/>
64+
<TextBlock Foreground="Black"
65+
Text="Dominant" />
6066
</Border>
6167

62-
<!--Base-->
63-
<Border Grid.ColumnSpan="3" Grid.Row="4"
64-
Margin="4" Padding="2">
68+
<!-- Base -->
69+
<Border Grid.Row="4"
70+
Grid.ColumnSpan="3"
71+
Margin="4"
72+
Padding="2">
6573
<Border.Background>
66-
<SolidColorBrush Color="{x:Bind AccentAnalyzer.BaseColor, Mode=OneWay}"/>
74+
<SolidColorBrush Color="{x:Bind AccentAnalyzer.BaseColor, Mode=OneWay}" />
6775
</Border.Background>
68-
<TextBlock Text="Base" Foreground="Black"/>
76+
<TextBlock Foreground="Black"
77+
Text="Base" />
6978
</Border>
70-
71-
<!--Primary-->
72-
<Border Grid.Column="1" Grid.Row="0"
73-
Margin="4" Padding="2">
79+
80+
<!-- Primary -->
81+
<Border Grid.Row="0"
82+
Grid.Column="1"
83+
Margin="4"
84+
Padding="2">
7485
<Border.Background>
75-
<SolidColorBrush Color="{x:Bind AccentAnalyzer.PrimaryAccentColor, Mode=OneWay}"/>
86+
<SolidColorBrush Color="{x:Bind AccentAnalyzer.PrimaryAccentColor, Mode=OneWay}" />
7687
</Border.Background>
77-
<TextBlock Text="Primary" Foreground="Black"/>
88+
<TextBlock Foreground="Black"
89+
Text="Primary" />
7890
</Border>
79-
<!--Secondary-->
80-
<Border Grid.Column="1" Grid.Row="1"
81-
Margin="4" Padding="2">
91+
<!-- Secondary -->
92+
<Border Grid.Row="1"
93+
Grid.Column="1"
94+
Margin="4"
95+
Padding="2">
8296
<Border.Background>
83-
<SolidColorBrush Color="{x:Bind AccentAnalyzer.SecondaryAccentColor, Mode=OneWay}"/>
97+
<SolidColorBrush Color="{x:Bind AccentAnalyzer.SecondaryAccentColor, Mode=OneWay}" />
8498
</Border.Background>
85-
<TextBlock Text="Secondary" Foreground="Black"/>
99+
<TextBlock Foreground="Black"
100+
Text="Secondary" />
86101
</Border>
87-
<!--Tertiary-->
88-
<Border Grid.Column="1" Grid.Row="2"
89-
Margin="4" Padding="2">
102+
<!-- Tertiary -->
103+
<Border Grid.Row="2"
104+
Grid.Column="1"
105+
Margin="4"
106+
Padding="2">
90107
<Border.Background>
91-
<SolidColorBrush Color="{x:Bind AccentAnalyzer.TertiaryAccentColor, Mode=OneWay}"/>
108+
<SolidColorBrush Color="{x:Bind AccentAnalyzer.TertiaryAccentColor, Mode=OneWay}" />
92109
</Border.Background>
93-
<TextBlock Text="Tertiary" Foreground="Black"/>
110+
<TextBlock Foreground="Black"
111+
Text="Tertiary" />
94112
</Border>
95113
</Grid>
96114
</Grid>
Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
<UserControl
2-
x:Class="AccentAnalyzerExperiment.Samples.AccentAnalyzerSampleOptionsPane"
3-
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4-
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5-
xmlns:local="using:AccentAnalyzerExperiment.Samples"
6-
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
7-
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
8-
mc:Ignorable="d">
1+
<UserControl x:Class="AccentAnalyzerExperiment.Samples.AccentAnalyzerSampleOptionsPane"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5+
xmlns:local="using:AccentAnalyzerExperiment.Samples"
6+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
7+
mc:Ignorable="d">
98

109
<StackPanel Orientation="Horizontal">
11-
<TextBox x:Name="UrlTextbox" PlaceholderText="Enter a url" MaxWidth="300"/>
12-
<Button Content="Set Image" Click="Button_Click"/>
10+
<TextBox x:Name="UrlTextbox"
11+
MaxWidth="300"
12+
PlaceholderText="Enter a url" />
13+
<Button Click="Button_Click"
14+
Content="Set Image" />
1315
</StackPanel>
1416
</UserControl>

0 commit comments

Comments
 (0)