protected override void OnLoad(EventArgs e) { base.OnLoad(e); mDispatcher = new DispatcherImpl(this); mBrowser.CoreWebView2InitializationCompleted += MBrowser_CoreWebView2InitializationCompleted; mBrowser.EnsureCoreWebView2Async(); //TEST COM CONNECTION. TO BE REMOVED string[] ports = SerialPort.GetPortNames(); if (ports.Length > 0) { BotMain bot = new BotMain(mDispatcher, "test"); ComConnection con = new ComConnection(mDispatcher); con.SetPortName(ports[0]); bot.SetConnection(con); bot.OnModAdded += Bot_OnModAdded; bot.IsAvailableChanged += Bot_IsAvailableChanged; bot.RunningChanged += Bot_RunningChanged; bot.Start(); } }