I do this by creating a custom
ListBox
style with an adjusted ItemContainerStyle.
<Style x:Key="FMListBox" TargetType="ListBox">
<Setter Property="ItemContainerStyle">
<Setter.Value>
<Style TargetType="ListBoxItem">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
<Grid x:Name="PART_ItemGrid" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock x:Name="PART_ItemNumber" Grid.Column="0"
Text={Binding Path=ItemNumber}" Margin="5" />
<TextBlock x:Name="PART_ItemText" Grid.Column="1"
Text="{Binding Path=Text}"
Margin="5" TextWrapping="Wrap" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Setter.Value>
</Setter>
</Style>
Your collection object will have to have the two bound properties
ItemNumber
and
Text
to make the code above work