In a previous question I wanted to know, how to set up the HierarchicalDataTemplate
for a TreeView
. This just works fine. My problem now is the following:
The class ClassPupils
looks like:
public class ClassPupils
{
public ClassPupils(Class @class)
{
this.Class = @class;
this.Pupils = new List<Pupil>();
}
public Class Class { get; set; }
public List<Pupil> Pupils { get; set; }
}
In my ViewModel I have an ObservableCollection<ClassPupils>
where the TreeView is bound to.
If a ClassPupil
has no Pupils in the Pupils-Collection, the item is not displayed. I don't understand why? I need to also display ClassPupils with no Pupils in the Pupils-Collection.