Пример #1
0
 /// <summary>
 /// MainPage Loaded
 /// </summary>
 public async void _MainPageLoaded()
 {
     UserShedule       = new ObservableCollection <Day>(await GetUserShedule());
     SheduleSwitchIsOn = SheduleTypeGetter.GetSheduleType();
     Changes           = new ObservableCollection <Change>(await GetUserChanges());
     MainPage.NavService.NavigateTo(typeof(Shedule), null);
 }
Пример #2
0
        /// <summary>
        /// Navigation
        /// </summary>
        private async void _NavigateToPage()
        {
            if (SelectedMenuItem != null)
            {
                if (SelectedMenuItem.Title == "Настройки")
                {
                    SplitViewSettings = !SplitViewSettings;
                }
                else if (SelectedMenuItem.NavigateTo != null)
                {
                    switch (SelectedMenuItem.Title)
                    {
                    case "Новости":
                        NewsItems = new ObservableCollection <news>(GetNewsItems());
                        break;

                    case "Расписание":
                        SheduleSwitchIsOn = SheduleTypeGetter.GetSheduleType();
                        Changes           = new ObservableCollection <Change>(await GetUserChanges());
                        break;

                    case "Домашнее задание":
                        HometaskItems = new ObservableCollection <Project.DB.Models.Hometask>(await GetHometaskItems());
                        break;
                    }
                    MainPage.NavService.NavigateTo(SelectedMenuItem.NavigateTo, null);
                }
            }
        }