/// <summary> /// Populates the page with content passed during navigation. Any saved state is also /// provided when recreating a page from a prior session. /// </summary> /// <param name="sender"> /// The source of the event; typically <see cref="NavigationHelper"/> /// </param> /// <param name="e">Event data that provides both the navigation parameter passed to /// <see cref="Frame.Navigate(Type, object)"/> when this page was initially requested and /// a dictionary of state preserved by this page during an earlier /// session. The state will be null the first time a page is visited.</param> private void NavigationHelper_LoadState(object sender, LoadStateEventArgs e) { if (!ViewModelLocator.Main.IsDataLoaded) { ViewModelLocator.Main.LoadData(); } }
/// <summary> /// Populates the page with content passed during navigation. Any saved state is also /// provided when recreating a page from a prior session. /// </summary> /// <param name="sender"> /// The source of the event; typically <see cref="NavigationHelper"/> /// </param> /// <param name="e">Event data that provides both the navigation parameter passed to /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and /// a dictionary of state preserved by this page during an earlier /// session. The state will be null the first time a page is visited.</param> private async void NavigationHelper_LoadState(object sender, LoadStateEventArgs e) { PlayersContextViewModel playersContext = PlayersContextViewModel.Instance; bool success = false; bool isNetAvailable = NetworkFunctions.GetIsNetworkAvailable(); success = await DataManagerLocator.PlayersDataManager.GetSeasonsAsync(isNetAvailable); ServiceInteractionNotify(success, isNetAvailable); }
/// <summary> /// Populates the page with content passed during navigation. Any saved state is also /// provided when recreating a page from a prior session. /// </summary> /// <param name="sender"> /// The source of the event; typically <see cref="NavigationHelper"/> /// </param> /// <param name="e">Event data that provides both the navigation parameter passed to /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and /// a dictionary of state preserved by this page during an earlier /// session. The state will be null the first time a page is visited.</param> private async void NavigationHelper_LoadState(object sender, LoadStateEventArgs e) { PlayersContextViewModel playersContext = PlayersContextViewModel.Instance; bool success = false; bool isNetAvailable = NetworkFunctions.GetIsNetworkAvailable(); success = await DataManagerLocator.PlayersDataManager.GetTeamsAsync(isNetAvailable); // sets the items source for the zoomed out view to the group data as well (semanticZoom.ZoomedOutView as ListViewBase).ItemsSource = cvsTeamItems.View.CollectionGroups; (semanticZoomSmall.ZoomedOutView as ListViewBase).ItemsSource = cvsTeamItems.View.CollectionGroups; ServiceInteractionNotify(success, isNetAvailable); }
/// <summary> /// Populates the page with content passed during navigation. Any saved state is also /// provided when recreating a page from a prior session. /// </summary> /// <param name="sender"> /// The source of the event; typically <see cref="NavigationHelper"/> /// </param> /// <param name="e">Event data that provides both the navigation parameter passed to /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and /// a dictionary of state preserved by this page during an earlier /// session. The state will be null the first time a page is visited.</param> private async void NavigationHelper_LoadState(object sender, LoadStateEventArgs e) { var localSettings = Windows.Storage.ApplicationData.Current.LocalSettings; var tab = localSettings.Values[Config.TeamsFeatureTabCache]; if (tab != null) { pvControl.SelectedIndex = (int)tab; } bool isNetAvailable = NetworkFunctions.GetIsNetworkAvailable(); bool success = false; success = await DataManagerLocator.TeamsDataManager.GetFranchisesAsync(isNetAvailable); (teamsSemanticZoom.ZoomedOutView as ListViewBase).ItemsSource = cvsFranchiseItems.View.CollectionGroups; (opponentsSemanticZoom.ZoomedOutView as ListViewBase).ItemsSource = cvsOpponentsItems.View.CollectionGroups; (teamResultsSemanticZoom.ZoomedOutView as ListViewBase).ItemsSource = cvsTeamResultItems.View.CollectionGroups; (teamDrillDownSemanticZoom.ZoomedOutView as ListViewBase).ItemsSource = cvsTeamDrillDownItems.View.CollectionGroups; ServiceInteractionNotify(success, isNetAvailable); }
/// <summary> /// Populates the page with content passed during navigation. Any saved state is also /// provided when recreating a page from a prior session. /// </summary> /// <param name="sender"> /// The source of the event; typically <see cref="NavigationHelper"/> /// </param> /// <param name="e">Event data that provides both the navigation parameter passed to /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and /// a dictionary of state preserved by this page during an earlier /// session. The state will be null the first time a page is visited.</param> private void navigationHelper_LoadState(object sender, LoadStateEventArgs e) { var localSettings = Windows.Storage.ApplicationData.Current.LocalSettings; var view = localSettings.Values[Config.TeamsFeatureTabCache] as string; if (view != null) { TeamsViewType savedView = (TeamsViewType)Enum.Parse(typeof(TeamsViewType), view); switch (savedView) { case TeamsViewType.Franchises: LoadView(typeof(TeamsFranchises), true); break; case TeamsViewType.Opponents: LoadView(typeof(TeamsOpponents), true); break; case TeamsViewType.Results: LoadView(typeof(TeamsResults), true); break; case TeamsViewType.DrillDown: LoadView(typeof(TeamsDrillDown), true); break; default: LoadView(typeof(PlayersBatters)); break; } } else { LoadView(typeof(TeamsFranchises)); } }