Esempio n. 1
0
        /// <summary>
        /// Attempts to get the underlying WPF UI element of the InfoBar
        /// </summary>
        public bool TryGetWpfElement(out Control?control)
        {
            ThreadHelper.ThrowIfNotOnUIThread();

            object?uiObject = null;

            control = null;
            _uiElement?.GetUIObject(out uiObject);

            if (uiObject is IVsUIWpfElement elm)
            {
                elm.GetFrameworkElement(out object frameworkElement);
                control = frameworkElement as Control;
            }

            return(control != null);
        }