/// <summary> /// Initializes the singleton application object. This is the first line of authored code /// executed, and as such is the logical equivalent of main() or WinMain(). /// </summary> public App() { this.InitializeComponent(); this.Suspending += OnSuspending; ThreadManage.Inital(); ThreadManage.AsyncDelegate(() => { MathF.InitalTabel(); }); ThreadManage.AsyncDelegate(() => { Class.WebClass.Initial(); }); }
protected override void OnLaunched(LaunchActivatedEventArgs e) { #if DEBUG if (System.Diagnostics.Debugger.IsAttached) { this.DebugSettings.EnableFrameRateCounter = true; } #endif //Debug.WriteLine(Colors.LightPink); //Debug.WriteLine(Colors.GhostWhite); var t = FontFamily.XamlAutoFontFamily; double width = Window.Current.Bounds.Width; double height = Window.Current.Bounds.Height; Class.Component.screenX = (float)width; Class.Component.screenY = (float)height; DX.DX_Core.Initial(); Swapchain = new DX.SwapChain(width, height); Main = new Canvas(); Main.Width = width; Main.Height = height; Main.Background = new SolidColorBrush(Colors.DimGray); Window.Current.Content = Main; Main.Children.Add(Swapchain); Window.Current.Activate(); Window.Current.SizeChanged += (o, a) => { double w = Window.Current.Bounds.Width; double h = Window.Current.Bounds.Height; Main.Width = w; Main.Height = h; Class.Component.screenX = (float)w; Class.Component.screenY = (float)h; Swapchain.ReSize(w, h); Class.PageManageEx.ReSize(); }; //delegate sub thread create ui ThreadManage.BindThreadResource(3); ThreadManage.AsyncDelegate(() => { Class.Main.Initial(Swapchain); }); #if phone StatusBar.GetForCurrentView().BackgroundColor = Colors.Black; StatusBar s = StatusBar.GetForCurrentView(); s.BackgroundOpacity = 1; s.ForegroundColor = Colors.White; SystemNavigationManager.GetForCurrentView().BackRequested += OnBackRequested; #endif Window.Current.CoreWindow.KeyUp += KeyUp; }