WPF Toolkit Color Picker edit template now no available colors WPF Toolkit Color Picker edit template now no available colors wpf wpf

WPF Toolkit Color Picker edit template now no available colors


yep, it has something wrong with it's style. But if you observe it's style carefully you will find out the problem:

search key word StandardColors or AvailableColors in xaml, here is StandardColors's template:

<ListBox x:Name="PART_StandardColors"  Grid.Row="1">        <ListBox.Style>            <Style TargetType="{x:Type ListBox}">            <Setter Property="Background" Value="Transparent"/>            <Setter Property="BorderThickness" Value="0"/>            <Setter Property="ItemsPanel">            ....        </ListBox.Style></ListBox>

you can see the listbox has not set itemsource, so you can add it by yourself:

<ListBox x:Name="PART_StandardColors" ItemsSource="{TemplateBinding StandardColors}"  Grid.Row="1">

edit listbox of AvailableColors :

 <ListBox x:Name="PART_AvailableColors" ItemsSource="{TemplateBinding AvailableColors}" Grid.Row="1">

now it works.