public async Task<AppsPageViewModel> GetHomePageViewModel() { if (_dataService != null) { var appDealsData = await _dataService.GetDealsHubCollectionFeedDataAsync(); //Populate view model properties if (appDealsData != null) { CollectionName = appDealsData.TopicName; CollectionSummary = appDealsData.TopicDescription; AppViewModels = new ObservableCollection<AppElementViewModel>(); foreach (var item in appDealsData.Items) { var appVM = new AppElementViewModel(item, _usePhoneFeed); AppViewModels.Add(appVM); } } } return this; }
private async Task<CategoryViewModel> GetAppDealsCategory() { var appDealsData = await _appStoreService.GetAppStoreDealsFeedDataAsync(); //Populate view model properties if (appDealsData != null) { var appViewModels = new ObservableCollection<AppElementViewModel>(); foreach (var item in appDealsData.Items) { var appVM = new AppElementViewModel(item, _usePhoneFeed); appViewModels.Add(appVM); } var categoryVM = new CategoryViewModel(appViewModels); return categoryVM; } return null; }