示例#1
0
        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
            };
        }
示例#2
0
        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();
        }
示例#3
0
        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
            };
        }
示例#4
0
 public async Task OnNavigatedToAsync()
 {
     Movies = await MoviesLoader.LoadMoviesAsync();
 }