Skip to content

Commit f448ee3

Browse files
committed
Add additional color picker samples showing only a palette
1 parent 90e8a34 commit f448ee3

File tree

2 files changed

+61
-2
lines changed

2 files changed

+61
-2
lines changed

Microsoft.Toolkit.Uwp.SampleApp/SamplePages/ColorPicker/ColorPickerButtonXaml.bind

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,5 +131,43 @@
131131
</controls:ColorPickerButton.ColorPickerStyle>
132132
</controls:ColorPickerButton>
133133
</StackPanel>
134+
<!-- Example 5 -->
135+
<StackPanel Grid.Row="3"
136+
Orientation="Vertical"
137+
HorizontalAlignment="Center"
138+
VerticalAlignment="Center"
139+
Spacing="20">
140+
<Border Background="{ThemeResource SystemChromeMediumColor}"
141+
CornerRadius="4"
142+
Height="100"
143+
Width="300"
144+
Padding="10">
145+
<TextBlock TextAlignment="Center"
146+
VerticalAlignment="Center">
147+
Ring-shaped spectrum <LineBreak />
148+
Alpha channel enabled <LineBreak />
149+
Only Color Palette Shown
150+
</TextBlock>
151+
</Border>
152+
<controls:ColorPickerButton x:Name="ColorPickerButton5"
153+
SelectedColor="Teal">
154+
<controls:ColorPickerButton.ColorPickerStyle>
155+
<Style TargetType="controls:ColorPicker">
156+
<Setter Property="ColorSpectrumShape"
157+
Value="Ring"/>
158+
<Setter Property="IsAlphaEnabled"
159+
Value="True"/>
160+
<Setter Property="IsHexInputVisible"
161+
Value="True"/>
162+
<Setter Property="IsColorSpectrumVisible"
163+
Value="False"/>
164+
<Setter Property="IsColorPaletteVisible"
165+
Value="True"/>
166+
<Setter Property="IsColorChannelTextInputVisible"
167+
Value="False"/>
168+
</Style>
169+
</controls:ColorPickerButton.ColorPickerStyle>
170+
</controls:ColorPickerButton>
171+
</StackPanel>
134172
</Grid>
135173
</Page>

Microsoft.Toolkit.Uwp.SampleApp/SamplePages/ColorPicker/ColorPickerXaml.bind

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
Alpha channel enabled
6161
</TextBlock>
6262
</Border>
63-
<controls:ColorPicker x:Name="ColorPickerButton3"
63+
<controls:ColorPicker x:Name="ColorPicker3"
6464
Color="Transparent"
6565
ColorSpectrumShape="Ring"
6666
IsAlphaEnabled="True"
@@ -78,12 +78,33 @@
7878
Saturation+Value spectrum channels
7979
</TextBlock>
8080
</Border>
81-
<controls:ColorPicker x:Name="ColorPickerButton4"
81+
<controls:ColorPicker x:Name="ColorPicker4"
8282
Color="Maroon"
8383
ColorSpectrumShape="Ring"
8484
ColorSpectrumComponents="SaturationValue"
8585
IsAlphaEnabled="True"
8686
IsHexInputVisible="True"/>
87+
<!-- Example 5 -->
88+
<Border Background="{ThemeResource SystemChromeMediumColor}"
89+
CornerRadius="4"
90+
Height="100"
91+
Width="300"
92+
Padding="10">
93+
<TextBlock TextAlignment="Center"
94+
VerticalAlignment="Center">
95+
Ring-shaped spectrum <LineBreak />
96+
Alpha channel enabled <LineBreak />
97+
Only Color Palette Shown
98+
</TextBlock>
99+
</Border>
100+
<controls:ColorPicker x:Name="ColorPicker5"
101+
Color="Teal"
102+
ColorSpectrumShape="Ring"
103+
IsAlphaEnabled="True"
104+
IsHexInputVisible="True"
105+
IsColorSpectrumVisible="False"
106+
IsColorPaletteVisible="True"
107+
IsColorChannelTextInputVisible="False"/>
87108
</StackPanel>
88109
</ScrollViewer>
89110
</Page>

0 commit comments

Comments
 (0)