コード例 #1
0
        public async Task ClassSelected(object sender, SelectionChangedEventArgs e)
        {
            var classVm = (ClassesViewModel)((ListView)sender).SelectedItem;

            try
            {
                var clazz = await _classesStorage.GetClassById(classVm.Id);

                if (clazz != null)
                {
                    NavigationService.Navigate(typeof(Views.ClassDetailPage), clazz);
                }
                else
                {
                    Views.Busy.SetBusy(true, _loader.GetString("HttpLoading"));
                    var quizClass = await _quizApi.GetClass(classVm.Id);

                    Views.Busy.SetBusy(false, null);
                    NavigationService.Navigate(typeof(Views.ClassDetailPage), quizClass);
                }
            }
            catch (Exception k)
            {
                var dialog = new MessageDialog($"Error: {k.Message}");
                await dialog.ShowAsync();

                return;
            }
        }
コード例 #2
0
        public async Task Selected(object sender, SelectionChangedEventArgs e)
        {
            var homeFeedItem = (IHomeItemVM)((ListView)sender).SelectedItem;

            if (homeFeedItem is ItemVM)
            {
                var item = homeFeedItem as ItemVM;
                var set  = await _quizApi.GetPrivateSet(item.SetId);

                NavigationService.Navigate(typeof(Views.SetDetailPage), set);
            }

            if (homeFeedItem is ClassFeedVM)
            {
                var item     = homeFeedItem as ClassFeedVM;
                var theClass = await _quizApi.GetClass(item.ClassId);

                NavigationService.Navigate(typeof(Views.ClassDetailPage), theClass);
            }

            if (homeFeedItem is StudySessionItemVM)
            {
                var item = homeFeedItem as StudySessionItemVM;
                var set  = await _quizApi.GetPrivateSet(item.SetId);

                NavigationService.Navigate(typeof(Views.SetDetailPage), set);
            }
        }
コード例 #3
0
        public async Task SelectedClass(object sender, SelectionChangedEventArgs e)
        {
            var quizClass = (GroupQViewModel)((ListView)sender).SelectedItem;

            Views.Busy.SetBusy(true, _loader.GetString("HttpLoading"));
            var fetchedClass = await _remoteApi.GetClass(quizClass.Id);

            Views.Busy.SetBusy(false, null);
            PivotNavIndex = 2;
            NavigationService.Navigate(typeof(Views.ClassDetailPage), fetchedClass);
        }
コード例 #4
0
        public async Task ListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var classVm = (ClassesViewModel)((ListView)sender).SelectedItem;

            try
            {
                var quizClass = await _quizApi.GetClass(classVm.Id);

                NavigationService.Navigate(typeof(Views.ClassDetailPage), quizClass);
            }
            catch (Exception k)
            {
                var dialog = new MessageDialog($"Error: {k.Message}");
                await dialog.ShowAsync();

                return;
            }
        }
コード例 #5
0
        public async Task <Classes> GetClass(int id)
        {
            var classes = await _quizletRESTApi.GetClass(id);

            return(classes);
        }