/// <summary> /// 在應用程式由終端使用者正常啟動時叫用。當啟動應用 /// 將在例如啟動應用程式時使用以開啟特定檔案。 /// </summary> /// <param name="e">關於啟動要求和處理序的詳細資料。</param> protected override void OnLaunched(LaunchActivatedEventArgs e) { Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); DirectXFactory.CreateIndependentResource(); LiPTT.CreateInstance(); LiPTT.ImageCache = new ImageCache(); Frame rootFrame = Window.Current.Content as Frame; Application.Current.Resources["SystemControlHighlightListAccentLowBrush"] = new SolidColorBrush(Windows.UI.Colors.Black); Application.Current.Resources["SystemControlHighlightListAccentMediumBrush"] = Application.Current.Resources["SystemControlHighlightListLowBrush"]; Application.Current.Resources["SystemControlHighlightListAccentHighBrush"] = Application.Current.Resources["SystemControlHighlightListLowBrush"]; // 當視窗中已有內容時,不重複應用程式初始化, // 只確定視窗是作用中 if (rootFrame == null) { // 建立框架做為巡覽內容,並巡覽至第一頁 rootFrame = new Frame(); rootFrame.NavigationFailed += OnNavigationFailed; if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) { //TODO: 從之前暫停的應用程式載入狀態 } // 將框架放在目前視窗中 Window.Current.Content = rootFrame; } if (e.PrelaunchActivated == false) { if (rootFrame.Content == null) { // 在巡覽堆疊未還原時,巡覽至第一頁, // 設定新的頁面,方式是透過傳遞必要資訊做為巡覽 // 參數 rootFrame.Navigate(typeof(MainPage), e.Arguments); } // 確定目前視窗是作用中 Window.Current.Activate(); } }
private void App_Resuming(object sender, object e) { DirectXFactory.CreateIndependentResource(); LiPTT.CreateInstance(); LiPTT.ImageCache = new ImageCache(); }