Microsoft.Silverlight.Testing.Controls.TreeViewItem.UpdateContainsSelection C# (CSharp) Method

UpdateContainsSelection() private method

Update the ancestors of this item when it changes selection.
Unselection updates need to occur before selection updates because the old and new selected items may share a partial path.
private UpdateContainsSelection ( bool selected ) : void
selected bool /// A value indicating whether the item is selected. ///
return void
        internal void UpdateContainsSelection(bool selected)
        {
            // Update the ContainsSelection flag from this item all the way up
            // through the tree.
            for (TreeViewItem item = ParentTreeViewItem; item != null; item = item.ParentTreeViewItem)
            {
                item.ContainsSelection = selected;
            }
        }