public override void ViewDidLoad() { View.BackgroundColor = UIColor.Black; bookButton = new UIButton(new RectangleF(10, 100, this.View.Frame.Width - 10, 40)); bookButton.BackgroundColor = UIColor.Clear; setButton(); bookButton.TouchUpInside += delegate { gymClass.book(); System.Console.WriteLine(gymClass.unbookAction); ScheduleTableViewDataSource ds = ( ScheduleTableViewDataSource )tableView.DataSource; ds.force = true; ds.ReloadData(); tableView.ReloadData(); if (!ds.isMyBookings) { gymClass = ds.getGymClass(indexPath); setButton(); } }; this.View.AddSubview(bookButton); }
public override void RowSelected(UITableView tableView, NSIndexPath indexPath) { ScheduleTableViewDataSource dataSource = ( ScheduleTableViewDataSource )tableView.DataSource; BookingViewController booking = new BookingViewController(dataSource.Gyms[indexPath.Row], tableView, indexPath); _navigator.PushViewController(booking, true); }
public void populateView() { ScheduleTableViewDataSource dataSource = (ScheduleTableViewDataSource)scheduleTableViewController.TableView.DataSource; dataSource.ReloadData(); scheduleTableViewController.TableView.ReloadData(); activityIndicator.RemoveFromSuperview(); View.AddSubview(scheduleTableViewController.View); }
public override void ViewDidAppear(bool animated) { ScheduleTableViewDataSource dataSource = (ScheduleTableViewDataSource)scheduleTableViewController.TableView.DataSource; if (dataSource.needToReload()) { scheduleTableViewController.View.RemoveFromSuperview(); View.AddSubview(activityIndicator); activityIndicator.StartAnimating(); ThreadStart workerTread = new ThreadStart(populateView); new Thread(workerTread).Start(); } }