是的,它的风格有问题。但如果你仔细观察它的风格,你会发现问题所在:
搜索关键字
StandardColors
或
AvailableColors
以xaml表示,这里是
标准颜色
的模板:
<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>
你可以看到列表框没有设置itemsource,所以你可以自己添加它:
<ListBox x:Name="PART_StandardColors" ItemsSource="{TemplateBinding StandardColors}" Grid.Row="1">
编辑列表框
可用颜色
:
<ListBox x:Name="PART_AvailableColors" ItemsSource="{TemplateBinding AvailableColors}" Grid.Row="1">
现在它起作用了。