public override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); viewModel = Locator.Get <BrowseViewModel>(); if (viewModel == null) { viewModel = Locator.GetNewInstance <BrowseViewModel>(); viewModel.PropertyChanged += ViewModel_PropertyChanged; Task.Run(async() => { await viewModel.GetTopRated().ConfigureAwait(false); await viewModel.GetPopular().ConfigureAwait(false); await viewModel.GetNowPlaying().ConfigureAwait(false); }); } Activity.InvalidateOptionsMenu(); }
private void InitNowPlayingRecyclerView() { nowPlayingManager = new LinearLayoutManager(Activity, LinearLayoutManager.Horizontal, false); nowPlaying.SetLayoutManager(nowPlayingManager); nowPlayingAdapter = new ItemAdapter(viewModel.GetCachedNowPlaying()); nowPlaying.SetAdapter(nowPlayingAdapter); var nowPlayingScrollListener = new ItemAdapterScollListener(nowPlayingManager); nowPlayingScrollListener.LoadMore += async delegate() { if (!viewModel.CanLoadMoreNowPlaying()) { return; } await viewModel.GetNowPlaying().ConfigureAwait(false); }; nowPlaying.AddOnScrollListener(nowPlayingScrollListener); }