/// <summary>
        /// Occurs after a brief delay following any document text, parse data, or view selection update, allowing consumers to update the user interface during an idle period.
        /// </summary>
        /// <param name="sender">The sender of the event.</param>
        /// <param name="e">The <see cref="RoutedEventArgs"/> that contains data related to this event.</param>
        private void OnSyntaxEditorUserInterfaceUpdate(object sender, RoutedEventArgs e)
        {
            // If there is a pending parse data change...
            if (hasPendingParseData)
            {
                // Clear flag
                hasPendingParseData = false;

                XmlParseData parseData = syntaxEditor.Document.ParseData as XmlParseData;
                if (parseData != null)
                {
                    // Output errors
                    errorListView.ItemsSource = parseData.Errors;

                    // Show well-formed state
                    messagePanel.Content = String.Format("Well-formed: {0}", parseData.IsWellFormed ? "Yes" : "No");
                }
                else
                {
                    // Clear UI
                    errorListView.ItemsSource = null;
                    messagePanel.Content      = "Ready";
                }
            }
        }
        /// <summary>
        /// Occurs after a brief delay following any document text, parse data, or view selection update, allowing consumers to update the user interface during an idle period.
        /// </summary>
        /// <param name="sender">The sender of the event.</param>
        /// <param name="e">The <see cref="RoutedEventArgs"/> that contains data related to this event.</param>
        private void OnXmlEditorUserInterfaceUpdate(object sender, RoutedEventArgs e)
        {
            // If there is a pending parse data change...
            if (hasPendingParseData)
            {
                // Clear flag
                hasPendingParseData = false;

                XmlParseData parseData = xmlEditor.Document.ParseData as XmlParseData;
                if (parseData != null)
                {
                    if (xmlEditor.Document.CurrentSnapshot.Length < 10000)
                    {
                        // Show the AST
                        if (parseData.Ast != null)
                        {
                            astOutputEditor.Document.SetText(parseData.Ast.ToTreeString(0));
                        }
                        else
                        {
                            astOutputEditor.Document.SetText(null);
                        }
                    }
                    else
                    {
                        astOutputEditor.Document.SetText("(Not displaying large AST for performance reasons)");
                    }

                    // Output errors
                    errorListView.ItemsSource = parseData.Errors;

                    // Show well-formed state
                    messagePanel.Content = String.Format("Well-formed: {0}", parseData.IsWellFormed ? "Yes" : "No");
                }
                else
                {
                    // Clear UI
                    astOutputEditor.Document.SetText(null);
                    errorListView.ItemsSource = null;
                    messagePanel.Content      = "Ready";
                }
            }
        }