Exemplo n.º 1
0
        private void ViewModel_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            if (Activity == null)
            {
                return;
            }
            if (!IsResumed)
            {
                return;
            }
            switch (e.PropertyName)
            {
            case "TopRatedMovies":
                topRatedAdapter.AddItems(viewModel.TopRatedMovies[viewModel.TopRatedPage]);
                break;

            case "PopularMovies":
                popularAdapter.AddItems(viewModel.PopularMovies[viewModel.PopularPage]);
                break;

            case "NowPlayingMovies":
                nowPlayingAdapter.AddItems(viewModel.NowPlayingMovies[viewModel.NowPlayingPage]);
                break;
            }
        }
        public async void FetchItems()
        {
            if (loading)
            {
                return;
            }
            loading = true;

            try {
                List <Item> ret = await ApiServices.FetchItemsAsync();

                mItemAdapter.AddItems(ret);
            } catch (Exception e) {
                Android.Util.Log.Error("FetchItems", e.ToString());
            }

            loading = false;
        }
        public async void FetchItems()
        {
            if (loading)
            {
                return;
            }
            loading = true;

            try {
                var         api = RestService.For <IApiInterface>("http://codepot.pelotaspl.us/");
                List <Item> ret = await api.GetItems("Token 30e4eb6453096eb7b92625c00cc8e35c289622cb");

                mItemAdapter.AddItems(ret);
            } catch (Exception e) {
                Android.Util.Log.Error("FetchItems", e.ToString());
            }

            loading = false;
        }
Exemplo n.º 4
0
        private void ViewModel_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            if (Activity == null)
            {
                return;
            }
            if (!IsResumed)
            {
                return;
            }
            switch (e.PropertyName)
            {
            case "SimilarMovies":
                similarAdapter.AddItems(viewModel.SimilarMovies[viewModel.SimilarPage]);
                break;

            case "IsFavorite":
                if (favorite != null)
                {
                    favorite.Text = viewModel.FavoriteButtonText;
                }
                break;
            }
        }