I’m receiving this error: “items collection must be empty before using itemssource” in a treeview.
My XAML code just contains:
<TreeView ItemsSource="{Binding Groups}">
</TreeView>
Groups is a class where contains only two properties: GroupID and GroupName. I’m sure that my collection has items, but I’m not sure what’s the reason for thix exception.
This error occurs when you have items added to the
Itemscollection and use theItemsSource, e.g.You can of course create such a problem in code too. So make sure you did not add anything manually somewhere.