// Token: 0x06005918 RID: 22808 RVA: 0x00189F90 File Offset: 0x00188190
        private void Select(bool selected)
        {
            TreeView     parentTreeView     = this.ParentTreeView;
            ItemsControl parentItemsControl = this.ParentItemsControl;

            if (parentTreeView != null && parentItemsControl != null && !parentTreeView.IsSelectionChangeActive)
            {
                object itemOrContainerFromContainer = parentItemsControl.GetItemOrContainerFromContainer(this);
                parentTreeView.ChangeSelection(itemOrContainerFromContainer, this, selected);
                if (selected && parentTreeView.IsKeyboardFocusWithin && !base.IsKeyboardFocusWithin)
                {
                    base.Focus();
                }
            }
        }
Esempio n. 2
0
        private void Select(bool selected)
        {
            TreeView     tree   = ParentTreeView;
            ItemsControl parent = ParentItemsControl;

            if ((tree != null) && (parent != null) && !tree.IsSelectionChangeActive)
            {
                // Give the TreeView a reference to this container and its data
                object data = parent.GetItemOrContainerFromContainer(this);
                tree.ChangeSelection(data, this, selected);

                // Making focus of TreeViewItem synchronize with selection if needed.
                if (selected && tree.IsKeyboardFocusWithin && !IsKeyboardFocusWithin)
                {
                    Focus();
                }
            }
        }