Exemple #1
0
        private async void ToggleFavoriteAsync(News.NewsInformation article)
        {
            _isBusy = true;
            RaiseCanExecuteChanged();
            App.ViewModel.IsBusy = true;

            await App.ViewModel.Favorites.AddAsync(await article.AsFavorite("Technology"));

            _isBusy = false;
            RaiseCanExecuteChanged();
            App.ViewModel.IsBusy = false;
        }
        public async static Task <FavoriteInformation> AsFavorite(this News.NewsInformation article, string categoryTitle)
        {
            //var category = await App.Database.GetCategoryAsync(categoryTitle);

            return(new FavoriteInformation()
            {
                ArticleDate = article.CreatedDate,
                Description = article.Description,
                ImageUrl = article.ImageUrl,
                Title = article.Title,
                CategoryTitle = categoryTitle
            });
        }
Exemple #3
0
        private async void ToggleFavoriteAsync(News.NewsInformation article)
        {
            this._isBusy = true;
            this.RaiseCanExecuteChanged();
            App.ViewModel.IsBusy = true;

            //TODO: Here
            FavoriteInformation favoriteInformation = await article.AsFavorite("Technology");

            await App.ViewModel.Favorites.AddAsync(favoriteInformation);

            this._isBusy = false;
            this.RaiseCanExecuteChanged();
            App.ViewModel.IsBusy = false;
        }
Exemple #4
0
 private async void NavigateToDetailAsync(News.NewsInformation article)
 {
     //await App.MainNavigation.PushAsync(new Pages.ItemDetailPage(article), true);
 }