private void InitTopRatedRecyclerView() { topRatedManager = new LinearLayoutManager(Activity, LinearLayoutManager.Horizontal, false); topRated.SetLayoutManager(topRatedManager); topRatedAdapter = new ItemAdapter(viewModel.GetCachedTopRated()); topRated.SetAdapter(topRatedAdapter); var topRatedScrollListener = new ItemAdapterScollListener(topRatedManager); topRatedScrollListener.LoadMore += async delegate() { if (!viewModel.CanLoadMoreTopRated()) { return; } await viewModel.GetTopRated().ConfigureAwait(false); }; topRated.AddOnScrollListener(topRatedScrollListener); }
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(); }