The TagEditor control provides a brief user interface allowing for the selection of a set of tests, used to filter the test run.
Inheritance: System.Windows.Controls.UserControl
        /// <summary>
        /// Handles the completion event on the tag expression editor to begin
        /// the test run using the user-provided settings.
        /// </summary>
        /// <param name="sender">The source object.</param>
        /// <param name="e">The event arguments.</param>
        protected virtual void OnTagExpressionSelected(object sender, TagExpressionEventArgs e)
        {
            TagEditor te = sender as TagEditor;

            if (te != null)
            {
                te.Complete -= OnTagExpressionSelected;
            }

            overlayGrid.Children.Clear();
            overlayGrid.Visibility = Visibility.Collapsed;

            if (_harness != null)
            {
                if (e != null && _harness.Settings != null)
                {
                    _harness.Settings.TagExpression = e.TagExpression;

                    // Provide clear indication of a tag expression when in use.
                    if (!string.IsNullOrEmpty(e.TagExpression))
                    {
                        Notifications.AddNotification(new Notification
                        {
                            Title   = "Tag Expression in Use",
                            Content = e.TagExpression,
                        });
                    }
                }

                // Start the test run
                StartTestRun();
            }
        }
        /// <summary>
        /// Waits for the Settings to become available, either by the service or
        /// system setting the instance property.
        /// </summary>
        /// <param name="sender">The source timer.</param>
        /// <param name="e">The event arguments.</param>
        private void StartupMonitor(object sender, EventArgs e)
        {
            if (_harness != null && _harness.Settings != null)
            {
                _startupTimer.Stop();
                _startupTimer.Tick -= StartupMonitor;
                _startupTimer       = null;

                // Tag expression support
                if (Application.Current.IfApplicationHostSource() &&
                    Application.Current.Host.Source.Query != null &&
                    Application.Current.Host.Source.Query.Contains("test_run"))
                {
                    StartTestRun();
                }
                else
                {
                    TagEditor tagEditor;
                    if (_harness.Settings != null)
                    {
                        tagEditor = _harness.Settings.StartRunImmediately ? null : _harness.Settings.SampleTags != null ? new TagEditor(_harness.Settings.TagExpression, _harness.Settings.SampleTags) : new TagEditor(_harness.Settings.TagExpression);
                    }
                    else
                    {
                        tagEditor = new TagEditor();
                    }

                    if (tagEditor == null)
                    {
                        StartTestRun();
                        return;
                    }

                    overlayGrid.Children.Add(tagEditor);
                    overlayGrid.Visibility = Visibility.Visible;
                    tagEditor.Complete    += OnTagExpressionSelected;
                }
            }
        }
        /// <summary>
        /// Handles the completion event on the tag expression editor to begin
        /// the test run using the user-provided settings.
        /// </summary>
        /// <param name="sender">The source object.</param>
        /// <param name="e">The event arguments.</param>
        protected virtual void OnTagExpressionSelected(object sender, TagExpressionEventArgs e)
        {
            TagEditor te = sender as TagEditor;

            if (te != null)
            {
                te.Complete -= OnTagExpressionSelected;
            }

            // overlayGrid.Children.Clear();
            // overlayGrid.Visibility = System.Windows.Visibility.Collapsed;

            if (_harness != null)
            {
                if (e != null && _harness.Settings != null)
                {
                    _harness.Settings.TagExpression = e.TagExpression;
                }

                // Start the test run
                StartTestRun();
            }
        }
        /// <summary>
        /// Waits for the Settings to become available, either by the service or
        /// system setting the instance property.
        /// </summary>
        /// <param name="sender">The source timer.</param>
        /// <param name="e">The event arguments.</param>
        private void StartupMonitor(object sender, EventArgs e)
        {
            if (_harness != null && _harness.Settings != null)
            {
                _startupTimer.Stop();
                _startupTimer.Tick -= StartupMonitor;
                _startupTimer = null;

                // Tag expression support
                if (Application.Current.IfApplicationHostSource() &&
                    Application.Current.Host.Source.Query != null &&
                    Application.Current.Host.Source.Query.Contains("test_run"))
                {
                    StartTestRun();
                }
                else
                {
                    TagEditor tagEditor;
                    if (_harness.Settings != null)
                    {
                        tagEditor = _harness.Settings.StartRunImmediately ? null : _harness.Settings.SampleTags != null ? new TagEditor(_harness.Settings.TagExpression, _harness.Settings.SampleTags) : new TagEditor(_harness.Settings.TagExpression);
                    }
                    else
                    {
                        tagEditor = new TagEditor();
                    }

                    if (tagEditor == null)
                    {
                        StartTestRun();
                        return;
                    }

                    overlayGrid.Children.Add(tagEditor);
                    overlayGrid.Visibility = Visibility.Visible;
                    tagEditor.Complete += OnTagExpressionSelected;
                }
            }
        }