How do I get the data in a TreeListView control when multiple items are selected?
How do I get the data in a TreeListView control when multiple items are selected?
@Qianzujin since the TreeListView inherits from the WPF-native ListView, you can just access the SelectedItems property of the ListView. If u want to use the MVVM pattern and bind the SelectedItems you have to use one of the workarounds (attached property or eventhandler in the code behind) like described here:
https://stackoverflow.com/questions/31176949/binding-selecteditems-of-listview-to-viewmodel
There is an open PR for supporting binding for the SelectedItems, however that needs more work done to it, see #3849
One other common option is to add an IsSelected property to each of your items in the tree view and then bind the IsSelected property of the item to that property. Then you can access it from your view model.