Пример #1
0
		public TCTableViewSource (UIViewController vc, RefreshTableHeaderView refreshHeaderView, UITableView tableView)
		{
			this.parentController = vc;
			_checkForRefresh = false;
			_reloading = false;
			_refreshHeaderView = refreshHeaderView;
			_table = tableView;

			TCNotificationCenter.defaultCenter.addObserver (this, Constants.kDissmisRefreshHeaderTable, tableFinishLoaded);
			TCNotificationCenter.defaultCenter.addObserver (this, MUtils.generateKeyRefreshTable(this.parentController), tableFinishLoaded);
		}
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();
		
			// Perform any additional setup after loading the view, typically from a nib.
			TCNotificationCenter.defaultCenter.addObserver (this, MConstants.kPostRefreshAllBooking, new
				TCSelector (refreshBooking));

			if (this.RespondsToSelector (new Selector ("setAutomaticallyAdjustsScrollViewInsets:"))) {
				this.AutomaticallyAdjustsScrollViewInsets = false;
			}
				
			badgeValue = null;

			this.tableView.RowHeight = 55.0f;
			this.tableView.Frame = this.View.Frame;
			this.tableView.BackgroundColor = TCTheme.getInstance.getThemeColor (Theme.BackgroundBody);
			refreshHeaderView = new RefreshTableHeaderView (this);
			refreshHeaderView.BackgroundColor = new UIColor (226f, 231f, 237f, 1f);

			this.tableView.AutoresizingMask = UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleWidth;
			bookingSource = new TCBookingTableViewSource (this);
			bookingSource.Delegate = this;
			this.tableView.Source = bookingSource;

			this.tableView.AddSubview (refreshHeaderView);
		
			bookingInfos = new List<BookingInfo> ();
			bookingEvents = new List<BookingEvent> ();

			loadingView = new TCLoadingOverlay (this, true, false, false);
			loadingView.build ();

			loadingView.show ();
			syncData ();

		}