private async void NavigationHelper_LoadState(object sender, LoadStateEventArgs e)
 {
     if (e.NavigationParameter is int)
     {
         this.DataContext = new EditLessonTimePageViewModel(App.Timetable.LessonTimes[(int)e.NavigationParameter], Strings.LessonTimeNumberTextFormat);
     }
     else
         await new MessageDialog(Strings.PageEditLessonTimeNotFoundWarning).ShowAsync();
 }
 private void NavigationHelper_LoadState(object sender, LoadStateEventArgs e)
 {
     this.DataContext = new DateOverviewPageViewModel(App.Timetable,
         Strings.DateTimePast,
         Strings.DateTimeToday,
         Strings.DateTimeThisWeek,
         Strings.DateTimeThisMonth,
         Strings.DateTimeFuture);
 }
예제 #3
0
 private async void NavigationHelper_LoadState(object sender, LoadStateEventArgs e)
 {
     if (e.NavigationParameter is int)
     {
         this.DataContext = new EditDatePageViewModel(App.Timetable.Dates[(int)e.NavigationParameter]);
     }
     else
         await new MessageDialog(Strings.PageEditDateNotFound, Strings.MessageBoxCriticalError).ShowAsync();
 }
 private async void NavigationHelper_LoadState(object sender, LoadStateEventArgs e)
 {
     if(e.NavigationParameter is int)
     {
         var data = App.Timetable.Subjects[(int)e.NavigationParameter];
         this.DataContext = new EditSubjectPageViewModel(data, App.Timetable);
     }
     else
         await new MessageDialog(Strings.PageEditSubjectNotFound).ShowAsync();
 }
 private async void NavigationHelper_LoadState(object sender, LoadStateEventArgs e)
 {
     if (this.DataContext == null)
     {
         if (e.NavigationParameter is int)
         {
             this.DataContext = new EditHomeworkPageViewModel(App.Timetable.Homeworks[(int)e.NavigationParameter], App.Timetable);
         }
         else
             await new MessageDialog(Strings.PageEditHomeworkNotFoundWarning).ShowAsync();
     }
 }
        private void NavigationHelper_LoadState(object sender, LoadStateEventArgs e)
        {
            this.DataContext = new GeneralDataEditorPageViewModel(App.Timetable);

            if (alreadyMovedToPage == false)
            {
                alreadyMovedToPage = true;

                if (e.NavigationParameter as string == "Subjects")
                    this.DataPivot.SelectedItem = this.SubjectsPivotItem;
                else if (e.NavigationParameter as string == "LessonTimes")
                    this.DataPivot.SelectedItem = this.LessonTimesPivotItem;
            }
        }
        private void NavigationHelper_LoadState(object sender, LoadStateEventArgs e)
        {
            if (!isLoaded)
            {
                this.DataContext = new HomeworkOverviewPageViewModel(App.Timetable, Strings.PageHomeworkOverviewAll);
                isLoaded = true;
                if (e.NavigationParameter is int)
                {
                    var data = App.Timetable.Subjects[(int)e.NavigationParameter];
                    var viewModel = ((HomeworkOverviewPageViewModel)this.DataContext);
                    viewModel.HomeworkFilter = new SubjectViewModel(data);

                    this.DataPivot.SelectedItem = FilteredPivotItem;
                }

                SortPopup.Visibility = Visibility.Collapsed;
            }
        }
예제 #8
0
 void NavigationHelper_LoadState(object sender, LoadStateEventArgs e)
 {
     Exception = (Exception)e.PageState["Exception"];
 }