protected override async void OnCreate(Bundle bundle) { base.OnCreate(bundle); var data = await MoviesLoader.LoadMoviesAsync(); ListAdapter = new ListAdapter <Movie>() { DataSource = data.ToList(), TextFunc = m => $"{m.Title}\n\n{m.Director} - {m.Country} - {m.Year}", UriFunc = m => m.Poster }; }
public async Task OnAppearingAsync() { AllMovies = await _moviesLoader.LoadMoviesAsync(); var splittedGenres = new List <string>(); var genres = AllMovies.Select(m => m.Genre); foreach (var genre in genres) { splittedGenres.AddRange(genre.Split(',').Select(s => s.Trim())); } MenuPageViewModel.Genres = splittedGenres.Distinct().ToList(); MenuPageViewModel.SelectedGenre = MenuPageViewModel.Genres.FirstOrDefault(); }
public override async void ViewDidLoad() { base.ViewDidLoad(); // LoadMoviesAsync the data var data = await MoviesLoader.LoadMoviesAsync(); // Register the TableView's data source TableView.Source = new ViewControllerSource <Movie>(TableView) { DataSource = data.ToList(), TextFunc = m => m.Title, DetailTextFunc = m => $"{m.Director} - {m.Country} - {m.Year}", UriFunc = m => m.Poster }; }
public async Task OnNavigatedToAsync() { Movies = await MoviesLoader.LoadMoviesAsync(); }