i am trying to add different styles for every listbox.Item in my project. Can anyone help me about that?
`
foreach (var item in orderList)
{
var itm = new ListBoxItem();
if (item.CustomOrder)
{
itm.Content = item;
itm.Style = customOrderStyle;
listbox.Items.Add(itm);
}
else
{
itm.Content = item;
itm.Style = newOrderStyle;
listbox.Items.Add(itm);
}
}
`
I know that i am adding Listbox item to the listbox, that's why content is doesnt shown. I try some different things too but still dont know how to solve it.
CodePudding user response: