Source (answer 2)
<ListBox.ItemContainerStyle> <Style TargetType="ListBoxItem"> <Setter Property="HorizontalContentAlignment" Value="Stretch" /> </Style> </ListBox.ItemContainerStyle>
Other properties of the listbox items can also be set here:
<Setter Property="IsEnabled" Value="False" />
Apparantly, however, you can't use bindings in these setters, while WPF does allow this.
But there is a workaround involving some coding that resolves the issue.
No comments:
Post a Comment