4 Answers, 1 is accepted
Could you please check out our First Look demo and let us know if the suggested approach is suitable for you? We have predefined the default ContentTemplate of the RadColorPickers in the Demo to achieve the Letters A, T, H etc:
<
telerik:RadColorPicker
x:Name
=
"textForegroundPicker"
RecentColorsVisibility
=
"{Binding IsRecentColorsVisible, Converter={StaticResource booleanToVisibilityConverter}}"
RecentColorsItemsSource
=
"{Binding ColorHistory}"
SelectedColor
=
"{Binding CurrentColor, Mode=TwoWay}"
>
<
telerik:RadColorPicker.ContentTemplate
>
<
DataTemplate
>
<
StackPanel
Height
=
"20"
Width
=
"18"
Margin
=
"-2"
>
<
Image
Source
=
"../Images/ColorPicker/FirstLook/TextColor.png"
/>
<
Rectangle
Height
=
"2"
Width
=
"18"
Fill
=
"{Binding SelectedColor, ElementName=textForegroundPicker, Converter={StaticResource colorToBrushConverter}}"
/>
</
StackPanel
>
</
DataTemplate
>
</
telerik:RadColorPicker.ContentTemplate
>
<
telerik:RadColorPicker.AdditionalContent
>
<
ContentControl
HorizontalContentAlignment
=
"Stretch"
ContentTemplate
=
"{StaticResource MoreColorsTemplate}"
Content
=
"{Binding}"
/>
</
telerik:RadColorPicker.AdditionalContent
>
</
telerik:RadColorPicker
>
Petar Mladenov
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
Thanks,
Akram
Disclaimer - I am new to Telerik and WPF. This isn't working for me - I get the following error: "Error 35 The resource "colorToBrushConverter" could not be resolved."
Here's what I have in my XAML....
<telerik:RadColorPicker Content="" x:Name="FillColorPicker" SelectedColor="Black">
<telerik:RadColorPicker.ContentTemplate>
<DataTemplate>
<Rectangle Height="10" Width="18" Fill="{Binding SelectedColor, ElementName=FillColorPicker, Converter={StaticResource colorToBrushConverter}}"/>
</DataTemplate>
</telerik:RadColorPicker.ContentTemplate>
</telerik:RadColorPicker>
I figured out that I was missing this....
<Grid.Resources>
<telerik:ColorToBrushConverter x:Key="colorToBrushConverter" />
</Grid.Resources>
Guess I should've waited a little longer to post. :-/