我正在尝试找出如何绑定复选框内容的背景色。这是我的代码,当然,背景设置只会改变复选框的颜色而不是文本背后的颜色。
<ListBox Name="ListBox1" ItemsSource="{Binding Path=relationshipTypesTable.dataTable.DefaultView}">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<CheckBox IsChecked="True" Content="{Binding typeDesc}" Background="{Binding color}"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>