public MainPage() { this.InitializeComponent(); //初次启动显示更新日志 if (SaveContainer.Values["first"] == null || SaveContainer.Values["first"].ToString() == "yes") { AboutGrid.Visibility = Visibility.Visible; SettingGridPopIn.Begin(); AboutPivot.SelectedIndex = 1; SaveContainer.Values["first"] = "no"; } //自动切换主题 if (SaveContainer.Values["theme"] == null || SaveContainer.Values["theme"].ToString() == "dark") { this.RequestedTheme = ElementTheme.Dark; ApplicationView.GetForCurrentView().TitleBar.ButtonForegroundColor = Colors.White; DarkRadioButton.IsChecked = true; } else { this.RequestedTheme = ElementTheme.Light; ApplicationView.GetForCurrentView().TitleBar.ButtonForegroundColor = Colors.Black; LightRadioButton.IsChecked = true; } //设置标题栏样式 var coreTitleBar = CoreApplication.GetCurrentView().TitleBar; coreTitleBar.ExtendViewIntoTitleBar = true; var titleBar = ApplicationView.GetForCurrentView().TitleBar; titleBar.ButtonBackgroundColor = new Color() { A = 0, R = 39, G = 40, B = 57 }; titleBar.ButtonInactiveBackgroundColor = new Color() { A = 0, R = 39, G = 40, B = 57 }; Window.Current.SetTitleBar(RealTitleGrid); SetTile(DotaMatchHelper.GetSteamID()); Current = this; if (NetworkCheckHelper.CheckNetwork() == false) { //断网 MainFrame.Navigate(typeof(NoNetworkPage)); } else { MainFrame.Navigate(typeof(HeroesPage), 1); } }
/// <summary> /// 关于此应用 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void AppBarButton_Click_3(object sender, RoutedEventArgs e) { AboutGrid.Visibility = Visibility.Visible; SettingGridPopIn.Begin(); AboutPivot.SelectedIndex = 0; }