/// <summary> /// 确认绑定 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Button_Click(object sender, RoutedEventArgs e) { if (Regex.IsMatch(SteamIDTextBox.Text, @"^\d+$")) { try { DotaMatchHelper.SetSteamID(SteamIDTextBox.Text); this.NavigationCacheMode = NavigationCacheMode.Disabled; if (NetworkCheckHelper.CheckNetwork() == false) { //断网 this.Frame.Navigate(typeof(NoNetworkPage)); } else { this.Frame.Navigate(typeof(MatchesPage)); } this.NavigationCacheMode = NavigationCacheMode.Enabled; BackgroundParticleCanvas.Paused = true; } catch { FailedTextBlock.Visibility = Visibility.Visible; SteamIDTextBox.Text = ""; } } }
public MatchesPage() { this.InitializeComponent(); this.NavigationCacheMode = NavigationCacheMode.Enabled; if (NetworkCheckHelper.CheckNetwork() == false) { return; } ID = DotaMatchHelper.GetSteamID(); //读取用户ID,如果为空就显示绑定页面 if (ID == "") { BindAccount(); } else { try { ShowPlayerProfileAsync(ID); ShowPieChart(ID); ShowPlayerTotalDataAsync(ID); ShowRecentMatches(ID); ShowHeroUsingInfo(ID); } catch { ShowDialog("数据加载失败,请稍后重试"); this.Frame.Navigate(typeof(BlankPage)); } } }
public ItemsPage() { this.InitializeComponent(); ConnectionProfile profile = NetworkInformation.GetInternetConnectionProfile(); if (NetworkCheckHelper.CheckNetwork() == false) { //断网 this.Frame.Navigate(typeof(NoNetworkPage)); return; } else { if (Secret.Count == 0) { try { AddAllItems(); } catch { AddAllItems(); } } } }
/// <summary> /// 重写导航至此页面的代码,显示动画 /// </summary> /// <param name="e"></param> protected override void OnNavigatedTo(NavigationEventArgs e) { if (e.Parameter is NavigationTransitionInfo transition) { navigationTransition.DefaultNavigationTransitionInfo = transition; } if (e.Parameter.GetType().Equals(typeof(int))) { try { selectedHeroPA = (int)e.Parameter; } catch { selectedHeroPA = 1; } } if (NetworkCheckHelper.CheckNetwork() == false) { return; } else { LoadAllHeroesList(); //判断是否需要下载新的数据,不用的话直接从DotaHeroHelper._data即可访问整个json,需要的话调用下载方法 //await APIHelper.DownloadHeroAttributesDataAsync(); } MainPage.Current.ShowHero.Begin(); base.OnNavigatedTo(e); }
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(object sender, RoutedEventArgs e) { if (NetworkCheckHelper.CheckNetwork() == false) { //断网 this.Frame.Navigate(typeof(NoNetworkPage)); } else if (this.Frame.CanGoBack) { this.Frame.GoBack(); } }
private void Button_Click_2(object sender, RoutedEventArgs e) { if (NetworkCheckHelper.CheckNetwork() == false) { //断网 this.Frame.Navigate(typeof(NoNetworkPage)); } else { this.Frame.Navigate(typeof(HeroesPage), 3); } }
/// <summary> /// 点击一条比赛记录查看详情 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void RecentMatchListView_SelectionChanged(object sender, SelectionChangedEventArgs e) { MatchPicture.Visibility = Visibility.Collapsed; if (NetworkCheckHelper.CheckNetwork() == false) { //断网 MatchInfoFrame.Navigate(typeof(NoNetworkPage)); } else { MatchInfoFrame.Navigate(typeof(MatchInfoPage), recentMatchesObservableCollection[RecentMatchListView.SelectedIndex]); } }
/// <summary> /// 刷新数据 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void MenuFlyoutItem_Click_1(object sender, RoutedEventArgs e) { DotaMatchHelper.PostRefreshAsync(ID); this.NavigationCacheMode = NavigationCacheMode.Disabled; if (NetworkCheckHelper.CheckNetwork() == false) { //断网 this.Frame.Navigate(typeof(NoNetworkPage)); } else { this.Frame.Navigate(typeof(MatchesPage)); } this.NavigationCacheMode = NavigationCacheMode.Enabled; }
/// <summary> /// 比赛 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void AppBarButton_Click_2(object sender, RoutedEventArgs e) { HeroRectangle.Width = 0; ItemRectangle.Width = 0; MatchRectangle.Width = 3; if (NetworkCheckHelper.CheckNetwork() == false) { //断网 MainFrame.Navigate(typeof(NoNetworkPage)); } else { MainFrame.Navigate(typeof(MatchesPage)); } }
public HeroInfoPage() { this.InitializeComponent(); if (HeroesPage.SelectedHero != null) { SelectedHero = HeroesPage.SelectedHero; } else { ShowDialog("抱歉,参数传递错误,请重试或联系开发人员,谢谢!"); return; } if (NetworkCheckHelper.CheckNetwork() == false) { //断网 return; } else { ShowHero(); } }