public override void ViewDidAppear(bool animated) { base.ViewDidAppear(true); this.TabBarController.ViewControllerSelected += async(sender, args) => { this.activityIndicator.StartAnimating(); this.TabBarController.TabBar.UserInteractionEnabled = false; this._movieList = await FilmAPISearch.PopulateMovieListAsync(FilmAPISearch.movieApi, await FilmAPISearch.movieApi.GetTopRatedAsync()); this.TableView.Source = new MovieListDataSource(this._movieList, OnSelectedMovie); this.TableView.ReloadData(); this.activityIndicator.StopAnimating(); this.TabBarController.TabBar.UserInteractionEnabled = true; }; }
public UIButton NavigationButton(UITextField movieField, UIActivityIndicatorView activityIndicator) { var navigationButton = UIButton.FromType(UIButtonType.RoundedRect); navigationButton.Frame = new CGRect(StartX, StartY + 2 * Height, this.View.Bounds.Width - 2 * StartX, Height); navigationButton.SetTitle("Get Movies", UIControlState.Normal); navigationButton.TouchUpInside += async(sender, args) => { navigationButton.Enabled = false; this.TabBarController.TabBar.UserInteractionEnabled = false; activityIndicator.StartAnimating(); this._movieList.Clear(); this._movieList = await FilmAPISearch.PopulateMovieListAsync(FilmAPISearch.movieApi, await FilmAPISearch.movieApi.SearchByTitleAsync(movieField.Text)); movieField.ResignFirstResponder(); this.NavigationController.PushViewController(new MovieListController(this._movieList), true); activityIndicator.StopAnimating(); navigationButton.Enabled = true; this.TabBarController.TabBar.UserInteractionEnabled = true; }; //this._movieList.Clear(); return(navigationButton); }