microsoft / microsoft-ui-xaml

Windows UI Library: the latest Windows 10 native controls and Fluent styles for your applications
MIT License
6.26k stars 674 forks source link

Proposal: Expose TreeNodeSelectionState for TreeView node #406

Open RafalSkorka opened 5 years ago

RafalSkorka commented 5 years ago

Proposal: Expose TreeNodeSelectionState for TreeView node

Summary

When a TreeView is set to SelectionMode="Multiple" there is no way to find out if a parent node which is selected is only partially selected or all its children are selected without iterating over children's collection.

Rationale

In order to find out if a parent node is fully or partially selected, I need to match all selected nodes to data source and verify all of them are selected which can potentially be a lengthy process and unnecessary since the parent node maintains this state internally.

Functional Requirements

Expose TreeNodeSelectionState read only property for a node when SelectionMode is Multiple.

Important Notes

Open Questions

predavid-zz commented 5 years ago

@RafalSkorka - very useful feature request indeed! Thanks for filing. We'll keep this on our radar for the next rev of WinUI, soon after we're done with the current investments we're cranking on for Win3.0, the roadmap for which is here : https://github.com/microsoft/microsoft-ui-xaml/issues/717

Please do review it and provide us with your feedback as well.

weitzhandler commented 4 months ago

Related: #512.