I have a ListBox which is bound to an instance of a list of elements of Class A, which is a collection.
class A : List<B>
{
public override ToString()
{
return "A";
}
}
class C
{
List<A> list;
}
ListBox:
<ListBox ItemsSource="{Binding list}"></ListBox>
When the application is run, every item shows “(Collection)”
What can I do to make each item show “A” instead of “Collection”?
To solve this problem I did the following: