Although somewhat experienced with writing Winforms applications, the... \"vagueness\" of WPF still eludes me in terms of best practices and design patterns.
Despite pop
Assuming TopicList
is not an ObservableCollection
therefore when you add items no INotifyCollection
changed is being fired to tell the binding engine to update the value.
Change your TopicList
to an ObservableCollection
which will resolve the current issue. You could also populate the List
ahead of time and then the binding will work via OneWay; however ObservableCollection
is a more robust approach.
EDIT:
Your TopicList
needs to be a property not a member variable; bindings require properties. It does not need to be a DependencyProperty
.
EDIT 2:
Modify your ItemTemplate
as it does not need to be a HierarchicalDataTemplate