public async Task LoadAsync() { AllMovies.Clear(); var movies = await _movieRepository.GetAllAsync(); foreach (var movie in movies) { var modelWrapper = new MovieWrapper(movie); AllMovies.Add(modelWrapper); } }
private async void OpenAndFilterNavigationView(OpenAndFilterNavigationViewEventArgs args) { if (String.IsNullOrEmpty(args.SelectedItem)) { await LoadAsync(); } else { var filteredMovies = AllMovies.Where(m => m.Name.ToLower().StartsWith(args.SelectedItem.ToLower())); List <MovieWrapper> tempList = new List <MovieWrapper>(); foreach (var filteredMovie in filteredMovies) { tempList.Add(filteredMovie); } AllMovies.Clear(); foreach (var item in tempList) { AllMovies.Add(item); } } }