From MSDN[^] - A ListBoxItem is a ContentControl, which means that it can contain a single object of any type (such as a string, an image, or a panel). This means you can directly add any type of content you wish (like a grid).
Grid grid = new Grid();
grid.Children.Add(new TextBlock { Text = "Hello"});
listBox.Items.Add(grid);
Or you can use a grid in your ItemTemplate
listBox.ItemsSource = new MyClass\[\] {
new MyClass { Property1 = "a1", Property2 = "a2", Property3 = "a3"},
new MyClass { Property1 = "b1", Property2 = "b2", Property3 = "b3"},
new MyClass { Property1 = "c1", Property2 = "c2", Property3 = "c3"},
};
and the FontWeightConverter
public class FontWeightConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
String item = value as String;
if (item == null) return FontWeights.Normal;
int index = int.Parse(item.Substring(1, 1));
return index % 3 == 1 ? Fon