private void StartThreads() { size = Device.Info.ScaledScreenSize; size = Device.Info.PixelScreenSize; size = new Forms.Size(885, 500); // 1.77 scale = new Forms.Size((Device.Info.PixelScreenSize.Width / size.Width), (Device.Info.PixelScreenSize.Height / size.Height)); XplatUIMine.GetInstance()._virtualScreen = new Rectangle(0, 0, (int)size.Width, (int)size.Height); XplatUIMine.GetInstance()._workingArea = new Rectangle(0, 0, (int)size.Width, (int)size.Height); new Thread(() => { AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; MissionPlanner.Program.Main(new string[0]); }).Start(); Forms.Device.StartTimer(TimeSpan.FromMilliseconds(1000 / 30), () => { Monitor.Enter(XplatUIMine.paintlock); if (XplatUIMine.PaintPending) { this.SkCanvasView.InvalidateSurface(); XplatUIMine.PaintPending = false; } Monitor.Exit(XplatUIMine.paintlock); return(true); }); }
private void StartThreads() { size = Device.Info.ScaledScreenSize; size = Device.Info.PixelScreenSize; size = new Forms.Size(1280, 720); scale = new Forms.Size((Device.Info.PixelScreenSize.Width / size.Width), (Device.Info.PixelScreenSize.Height / size.Height)); XplatUIMine.GetInstance()._virtualScreen = new Rectangle(0, 0, (int)size.Width, (int)size.Height); XplatUIMine.GetInstance()._workingArea = new Rectangle(0, 0, (int)size.Width, (int)size.Height); new Thread(() => { AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; MissionPlanner.Program.Main(new string[0]); MessageBox.Show("Application Exit"); return; var frm = new Form() { Width = (int)Forms.Application.Current.MainPage.Width, Height = (int)Forms.Application.Current.MainPage.Height, Location = new System.Drawing.Point(0, 0) }; frm.Controls.Add(new Label() { Text = "this is a test", Location = new System.Drawing.Point(frm.Width / 2, frm.Height / 2) }); /* * frm.Controls.Add(new RadioButton()); * frm.Controls.Add(new CheckBox()); * frm.Controls.Add(new ComboBox()); * frm.Controls.Add(new DomainUpDown()); * frm.Controls.Add(new DataGridView()); * frm.Controls.Add(new TextBox()); */ var param = new ConfigRawParams() { Location = new System.Drawing.Point(0, 0), Size = new System.Drawing.Size(frm.Width, frm.Height) }; frm.Controls.Add(param); frm.Shown += (sender, args) => { param.Activate(); }; AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; Application.Run(frm); }).Start(); Forms.Device.StartTimer(TimeSpan.FromMilliseconds(100), () => { this.SkCanvasView.InvalidateSurface(); return(true); }); this.SkCanvasView.PaintSurface += SkCanvasView_PaintSurface; this.SkCanvasView.EnableTouchEvents = true; this.SkCanvasView.Touch += SkCanvasView_Touch; }