public override void OnLoaded()
        {
            _vueData.Initialize();

            Task.Run(() =>
            {
                BeforeVue();

                foreach (var comp in _componentTypes)
                {
                    Execute(CreateComponentTemplate(comp.Value));
                }

                Execute(VueTemplates.Format_VueCore(VueElementID,
                                                    _vueData.AsVueDataString(), base.IPCAvailable
                                                    .Select(x => $"'{x}':{x}")
                                                    .ToArray()));
            }).ContinueWith((t) =>
            {
                AggregateException ex = t.Exception;
                if (ex != null && ex.InnerExceptions.Count > 0)
                {
                    foreach (Exception x in ex.InnerExceptions)
                    {
                        WebAppLogger.Log(WebAppLogLevel.Error, $"[{x.GetType().Name}]{x.Message}");
                    }
                }
            });
        }
 public void LoadUrl(string url)
 {
     RunOnReady(() =>
     {
         WebAppLogger.Log(WebAppLogLevel.Info, "Loading Url:");
         _browser.Browser.GetMainFrame().LoadUrl(url);
     });
 }
        internal void BrowserCreated(object sender, EventArgs e)
        {
            // _browser = browser;
            _browserWindowHandle = _core.CefBrowser.GetHost().GetWindowHandle();

            WebAppLogger.Log(WebAppLogLevel.Info, $"Chromium Handle: {_browserWindowHandle}");

            if (CefRuntime.Platform == CefRuntimePlatform.Linux)
            {
                _display = XOpenDisplay(IntPtr.Zero);
            }

            //ResizeWindow(_browserWindowHandle, Width, Height);

            if (BrowserReady != null)
            {
                BrowserReady();
            }
        }
        protected override void OnHandleCreated(EventArgs e)
        {
            base.OnHandleCreated(e);

            if (DesignMode)
            {
                // if (!_handleCreated) Paint += PaintInDesignMode;
            }
            else
            {
                _windowInfo = CefWindowInfo.Create();
                _windowInfo.SetAsChild(Handle, new CefRectangle {
                    X = 0, Y = 0, Width = _initialWidth, Height = _initialHeight
                });
                WebAppLogger.Log(WebAppLogLevel.Info, $"WindowInfo: ({_initialWidth},{_initialHeight})");
                _core.Create(_windowInfo);
            }

            _handleCreated = true;
        }
        public void Startup()
        {
            WebAppLogger.Log(WebAppLogLevel.Info, "Chromium Startup");
            _browserContainer.Dock = DockStyle.Fill;
            _browser = new CefWebBrowser(this, this.Width, this.Height);
            _browser.OnProcessMessage += ProcessMessage;
            _browser.BrowserReady     += BrowserReady;
            _browser.BackColor         = Color.DarkRed;

            _browser.StartUrl = "https://google.com";
            _browser.Dock     = DockStyle.Fill;

            _browserContainer.Controls.Add(_browser);

            Controls.Add(_browserContainer);
            //Opacity = 0;
            //Show();
            //Hide();
            //Opacity = 1;
        }