예제 #1
0
        public void NavigateToGroup(ItemsGroup dataContext)
        {
            string key = dataContext.Key;

            _videosRepository.Collections[key] = dataContext;
            _navigationService.For<GroupViewModel>().WithParam(vm => vm.RepositoryKey, key).Navigate();
        }
예제 #2
0
        public async void Load()
        {
            Items.Clear();

            YouTubeService service = new YouTubeService(
                new BaseClientService.Initializer() {
                    HttpClientInitializer = await _authenticationService.GetUserCredential()
                });

            var activititiesRequest = service.Activities.List("snippet");
            activititiesRequest.Home = true;

            ItemsGroup activities = new ItemsGroup(
                new IncLoadingCollection(d => activititiesRequest.ExecuteAsync(d)),
                "Recent activities");
            await activities.Items.LoadMoreItemsAsync(8);

            Items.Add(activities);

            var videosRequest = service.Videos.List("snippet");
            videosRequest.Chart = VideosResource.ListRequest.ChartEnum.MostPopular;

            ItemsGroup videos = new ItemsGroup(
                new IncLoadingCollection(d => videosRequest.ExecuteAsync(d)),
                "Popular videos");
            await videos.Items.LoadMoreItemsAsync(8);

            Items.Add(videos);
        }