Esempio n. 1
0
        internal ExplorerTreeViewItem FocusExplorerEFElement(ExplorerEFElement explorerElement, bool focusAncestorIfNotAvailable)
        {
            if (null == explorerElement)
            {
                Debug.Assert(false, "FocusExplorerEFElement needs non-null explorerElement");
                return(null);
            }

            var treeViewItem = GetTreeViewItem(explorerElement, focusAncestorIfNotAvailable);

            if (null != treeViewItem)
            {
                explorerElement.ExpandTreeViewToMe();
                ScrollToMakeVisible(treeViewItem);

                // having scrolled to the correct position, do the actual focus
                Keyboard.Focus(treeViewItem);

                return(treeViewItem);
            }
            else
            {
                Debug.Assert(
                    false, "FocusExplorerEFElement: Could not find ExplorerTreeViewItem for ExplorerEFElement " + explorerElement.Name);
                return(null);
            }
        }
Esempio n. 2
0
        internal bool SelectTreeViewItem(ExplorerEFElement explorerElement)
        {
            if (explorerElement != null)
            {
                explorerElement.ExpandTreeViewToMe();
                ExplorerTreeView.UpdateLayout();
                var tvi = FocusExplorerEFElement(explorerElement, false);
                Debug.Assert(null != tvi, "Could not find TreeViewItem for ExplorerEFElement " + explorerElement.Name);
                return(null != tvi);
            }

            return(false);
        }
Esempio n. 3
0
        internal ExplorerTreeViewItem FocusExplorerEFElement(ExplorerEFElement explorerElement, bool focusAncestorIfNotAvailable)
        {
            if (null == explorerElement)
            {
                Debug.Assert(false, "FocusExplorerEFElement needs non-null explorerElement");
                return null;
            }

            var treeViewItem = GetTreeViewItem(explorerElement, focusAncestorIfNotAvailable);
            if (null != treeViewItem)
            {
                explorerElement.ExpandTreeViewToMe();
                ScrollToMakeVisible(treeViewItem);

                // having scrolled to the correct position, do the actual focus
                Keyboard.Focus(treeViewItem);

                return treeViewItem;
            }
            else
            {
                Debug.Assert(
                    false, "FocusExplorerEFElement: Could not find ExplorerTreeViewItem for ExplorerEFElement " + explorerElement.Name);
                return null;
            }
        }
Esempio n. 4
0
        internal bool SelectTreeViewItem(ExplorerEFElement explorerElement)
        {
            if (explorerElement != null)
            {
                explorerElement.ExpandTreeViewToMe();
                ExplorerTreeView.UpdateLayout();
                var tvi = FocusExplorerEFElement(explorerElement, false);
                Debug.Assert(null != tvi, "Could not find TreeViewItem for ExplorerEFElement " + explorerElement.Name);
                return (null != tvi);
            }

            return false;
        }