Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You can use the Selected event (Reference: <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.treeviewitem.selected.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/system.windows.controls.treeviewitem.selected.aspx</a>) on the TreeViewItem.</p> <p>When this event fires for Section1 or Section2, you can set the IsSelected property (Reference: <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.treeviewitem.isselected.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/system.windows.controls.treeviewitem.isselected.aspx</a>) on the TreeViewItem to false.</p> <p>You can also use the SelectedItemChanged event (Reference: <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.treeview.selecteditemchanged.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/system.windows.controls.treeview.selecteditemchanged.aspx</a>) on the TreeView itself to unselect specific items when they are selected. </p> <p>Make sure you unsubscribe before you set the IsSelect property, otherwise the event may fire multiple times. And don't forget to re-subscribe to the event after you set the IsSelect property.</p> <p>Edit: Or even better, use the Collapsed event (Reference: <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.treeviewitem.collapsed.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/system.windows.controls.treeviewitem.collapsed.aspx</a>) that is on the TreeViewItem.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload