Add bindable DP `TreeListView.SelectedItems`
This adds a DP called SelectedItems to the TreeListView control.
There was a small hurdle to overcome, because of the TreeListViews impl., which adds (when expanding) and deletes (when collapsing) childs.
Bascially internally there are now 2 SelectedItems Lists:
- The
base.SelectedItems(inherited fromListView) which only contains the visually selected items - The
SelectedItems(Dependency property) which always contains all of the selected items. This is the one the consumers see/use.
I also added tests for this new DP and showcases to the MD2&3 demos.
The only thing left to solve is dealing with the correct selection of duplicate items. At least this is the last and only failing test (TreeListView_AddingDuplicateItemsAndSelectingWithArrowKeys_SelectsEachItemInTurn) you have added.
So far I was unable to find a solution for this. Keeping track of the selected items via reference (that's how it currently works) clearly doesn't work with duplicate items.
I was trying to make it work by keeping track of the selected item(s) via their index. This however also doesn't work since the TreeListView removes child nodes when collapsing a parent node. Maybe some kind of an internal data structure is the solution here?
Help and opinions on this are welcome.
This PR is marked stale because it has been open 60 days with no activity. Remove stale label or update the PR, otherwise it will be closed in 14 days.
This PR was closed because it has been stalled for 14 days with no activity.
This PR is marked stale because it has been open 60 days with no activity. Remove stale label or update the PR, otherwise it will be closed in 14 days.
This PR is marked stale because it has been open 60 days with no activity. Remove stale label or update the PR, otherwise it will be closed in 14 days.