Beispiel #1
0
        /// <summary>Hides and unloads the auto-completion pop-up window.</summary>
        private void HidePopup()
        {
            if (completionPanel == null)
            {
                return;
            }
            completionPanel.ListBoxItemDoubleClick -= ListItem_DoubleClick;

            if (completionPanel.IsOpen)
            {
                completionPanel.IsOpen = false;
            }

            completionPanel = null;
        }
Beispiel #2
0
        /// <summary>Instantiates and displays a new auto-completion window using the supplied
        /// auto-completion tree.</summary>
        ///
        private void ShowPopup(List <ExpressionNode> rootNodes)
        {
            if (completionPanel != null && completionPanel.IsOpen)
            {
                HidePopup();
            }

            completionPanel = new AutoCompletionPopup
            {
                DataContext     = rootNodes,
                PlacementTarget = editor,
                Placement       = System.Windows.Controls.Primitives.PlacementMode.Bottom
            };

            completionPanel.ListBoxItemDoubleClick += ListItem_DoubleClick;
        }