I would like to have my WPF Listbox, which is databound, generate subclassed ListboxItems instead of the regular ListboxItems. In this case, a DataTemplate is not sufficient because I need some custom properties for the subclassed ListBoxItems.
Is there a way to have the ListBox generated mySubClassedListBoxItem items for the bound data?
Thanks,
Bart
Best Answer
You need to create your own subclass of ListBox so you can override the method which creates the container, e.g.