コード例 #1
0
 protected override void OnNavigatedFrom(NavigationEventArgs e)
 {
     base.OnNavigatedFrom(e);
     MajorScoreViewModel.Dispose();
     SecondMajorScoreViewModel.Dispose();
     StudentInfoViewModel.Dispose();
 }
コード例 #2
0
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            Analytics.TrackEvent("Navigation", new Dictionary <string, string>()
            {
                { "Page", "Score" }
            });
            Application.Current.GetService <INotificationService>().ClearToast(ToastTypes.ScoreChange);
            bool  signedIn = Application.Current.GetService <ICredentialService>().IsSignedIn;
            Task  studentInfoUpdateTask = StudentInfoViewModel.StartUpdateAsync(signedIn);
            Task  majorUpdateTask       = MajorScoreViewModel.StartUpdateAsync(signedIn);
            await studentInfoUpdateTask;

            if (StudentInfoViewModel.Value.HasSecondMajor && ScoreSectionsPivot.Items.Count == 1)
            {
                ScoreSectionsPivot.Items.Add(secondMajorItem);
            }
            await majorUpdateTask;
        }