public static WebView add_Chrome_Wpf(this System.Windows.Forms.Control control, bool addNavigationBar = false)
        {
            var autoResetEvent = new AutoResetEvent(false);
            var _webView       = (WebView)control.invokeOnThread(
                () => {
                var webView = control.add_WPF_Control <WebView>();

                webView.PropertyChanged += (browserCore, eventArgs) =>
                {
                    if (eventArgs.PropertyName == "IsBrowserInitialized")
                    {
                        autoResetEvent.Set();
                    }
                };
                return(webView);
            });

            autoResetEvent.WaitOne(2000);
            if (addNavigationBar)
            {
                control.insert_Above(20)
                .add_TextBox("Url:", "")
                .onEnter((text) => _webView.open_ASync(text.info()));
                //webView.onNavigate((url)=> urlTextBox.set_Text(url));
            }
            return(_webView);
        }
        //#region Add WPF Controls to ascx_Xml_Host or Controls

        public static Label add_WPF_Label(this System.Windows.Forms.Control winFormsControl, string text)
        {
            var label = winFormsControl.add_WPF_Control <Label>();

            label.set_Text_Wpf(text);

            return(label);
        }
        //#region TreeView

        public static TreeView add_WPF_TreeView(this System.Windows.Forms.Control control)
        {
            return(control.add_WPF_Control <TreeView>());
        }
Example #4
0
 public static WpfTextEditor add_WpfTextEditor(this System.Windows.Forms.Control control)
 {
     return(control.add_WPF_Control <WpfTextEditor>());
 }