Hello,
I have a label inside a listbox and I tried to add background color dynamically. but it is not worked for me. can someone help me? code as below,
<ListBox x:Name="libTest" ItemsSource="{Binding}" ><ListBox.ItemTemplate>
<HierarchicalDataTemplate>
<StackPanel Orientation="Horizontal">
<Label Background="{Binding TestColor}" Height="30" Width="20"/>
<TextBlock Text="{Binding TestName}"/>
</StackPanel>
</HierarchicalDataTemplate>
</ListBox.ItemTemplate>
</ListBox>
Here TestName binding correctly. But TestColor not working.