public YelpResultTableSource(NewActivityController theActivity)
 {
     curActivity = theActivity;
 }
		private void AddNewActivityToDate()
		{
			NewActivityController newActivityController = new NewActivityController ();
			if (newActivityController != null) {
				newActivityController.ActivityCreated += (Activity newActivity) => {
					// add the new activity
					if (newDate.activities == null)
						newDate.activities = new List<Activity>();
					newDate.activities.Add(newActivity);
					ActivityTableView.ReloadData();
					RedoLayoutSizes();

				};
				PresentModalViewController (newActivityController, true);
			}
		}
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();
			newDate = new ProposedDate ();
			// Perform any additional setup after loading the view, typically from a nib.
			modalPicker = new ModalPickerViewController(ModalPickerType.Date, "2 hrs to 10 days", this) {
				HeaderBackgroundColor = UIColor.Red,
				HeaderTextColor = UIColor.White,
				TransitioningDelegate = new ModalPickerTransitionDelegate(),
				ModalPresentationStyle = UIModalPresentationStyle.Custom
			};

			modalPicker.DatePicker.Mode = UIDatePickerMode.DateAndTime;
			DateTime minDate = DateTime.UtcNow.AddHours (2);
			DateTime maxDate = DateTime.UtcNow.AddDays (10);

			modalPicker.DatePicker.MinimumDate = minDate.DateTimeToNSDate();
			modalPicker.DatePicker.MaximumDate = maxDate.DateTimeToNSDate();
			modalPicker.DatePicker.MinuteInterval = 15;
			modalPicker.OnModalPickerDismissed += HandleDatePicked;


			DateStartBtn.TouchUpInside += (object sender, EventArgs e) => 
			{
				ShowDateController();


			};

			CancelDateBtn.TouchUpInside += (object sender, EventArgs e) => {
				DismissViewController(true, null);
			};

			CreateDateBtn.TouchUpInside += (object sender, EventArgs e) => {
				LettuceServer.Instance.CreateDate(newDate, (theDate) =>
					{
						newDate = theDate;
						InvokeOnMainThread(() => {
						DismissViewController(true, null);
						if (DateCreated != null)
							DateCreated(theDate);
						});
					});

			};

			AddActivityBtn.TouchUpInside += (sender, e) => {
				NewActivityController newActivityController = new NewActivityController ();
				if (newActivityController != null) {
					newActivityController.ActivityCreated += (Activity newActivity) => {
						// add the new activity
						if (newDate.activities == null)
							newDate.activities = new List<Activity>();
						newDate.activities.Add(newActivity);
						ActivityTableView.ReloadData();
						RedoLayoutSizes();

					};
					PresentModalViewController (newActivityController, true);
				}
			};

			ActivityTableView.RegisterNibForCellReuse (UINib.FromName (ActivitySummaryCell.Key, NSBundle.MainBundle), ActivitySummaryCell.Key);
			ActivityTableView.Source = new DateActivityDataSource (this.newDate);
			ActivityTableView.RowHeight = 164;

			keyWatcher = NSNotificationCenter.DefaultCenter.AddObserver (UITextView.TextDidChangeNotification, (notification) => {
				newDate.description = DescriptionText.Text;
				newDate.title = HeadlineText.Text;
				UpdateCreateButton();
			});


		}