async void LoadMovies(string movieTitle) { ProgressBarEnabled = true; var client = new ServiceReferenceFilmSearch.WSFilmSearchPortTypeClient(); ServiceReferenceFilmSearch.SearchMoviesByNameResponse result = await client.SearchMoviesByNameAsync(movieTitle); foreach (var movieResult in result.@return) { this.MovieCollection.Add(new VMItemFilm() { Id = movieResult.Id, Title = movieResult.Title, Description = movieResult.Description, Year = movieResult.Year, Poster = movieResult.Poster }); } Movie = movieTitle; ProgressBarEnabled = false; }
async void LoadMovies(string movieTitle) { ProgressBarEnabled = true; MovieCollection.Clear(); var client = new ServiceReferenceFilmSearch.WSFilmSearchPortTypeClient(); ServiceReferenceFilmSearch.SearchMoviesByNameResponse result = await client.SearchMoviesByNameAsync(movieTitle); foreach (var film in result.@return) { this.MovieCollection.Add(new MEItemFilm() { Id = film.Id, Title = film.Title, Description = film.Description, Year = film.Year, Poster = film.Poster }); } ProgressBarEnabled = false; UpdateAll(); clearMovieCommand.Value.RaiseCanExecuteChanged(this); }