Exemplo n.º 1
0
        async Task ExecuteSearchMoviesCommand(string text)
        {
            IsBusy = true;

            try
            {
                DiscoverMovies.Clear();

                if (!string.IsNullOrEmpty(text))
                {
                    var searchResult = await MoviesService.DiscoverMovies(text);

                    foreach (var movie in searchResult)
                    {
                        DiscoverMovies.Add(movie);
                    }
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
            finally
            {
                IsBusy = false;
            }
        }