public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();

			//Setup some of our UI
			NavigationItem.LeftItemsSupplementBackButton = true;
			menu = new UIBarButtonItem("Menu", UIBarButtonItemStyle.Bordered, (sender, e) => ShowPopover ());
			menu.SetBackgroundImage (Theme.DarkBarButtonItem, UIControlState.Normal, UIBarMetrics.Default);
			hide = new UIBarButtonItem("Hide", UIBarButtonItemStyle.Bordered, (sender, e) => HidePopover ());
			hide.SetBackgroundImage (Theme.DarkBarButtonItem, UIControlState.Normal, UIBarMetrics.Default);
			SwitchOrientation (InterfaceOrientation, false);

			//Hook up our controllers
			detailsController = ChildViewControllers[0] as AssignmentDetailsController;
			menuController = ChildViewControllers[1] as MenuController;

			detailsController.StatusChanged += (sender, e) => {
				menuController.UpdateAssignment ();
			};
			detailsController.Completed += (sender, e) => {
				//Only perform the Seque if the screen is not already visible
				if (!detailsController.IsViewLoaded || detailsController.View.Window == null) {
					PerformSegue ("AssignmentDetails", this);
				}
			};
			menuController.MenuChanged += (sender, e) => {
				detailsController.SectionSelected (e.TableView, e.IndexPath, e.Animated);
			};
			menuController.AssignmentCompleted += (sender, e) => {
				//Only perform the Seque if the screen is not already visible
				if (!detailsController.IsViewLoaded || detailsController.View.Window == null) {
					PerformSegue ("AssignmentDetails", this);
				}
			};
			menuController.StatusChanged += (sender, e) => detailsController.UpdateAssignment ();
		}
示例#2
0
            public TableSource(MenuController controller)
            {
                this.controller = controller;
                assignmentViewModel = ServiceContainer.Resolve<AssignmentViewModel>();

                summaryCell = new UITableViewCell (UITableViewCellStyle.Default, null);
                summaryCell.TextLabel.Text = "Summary";
                SetupCell (summaryCell, start: true);

                mapCell = new UITableViewCell (UITableViewCellStyle.Default, null);
                mapCell.TextLabel.Text = "Map";
                SetupCell (mapCell);

                itemsCell = new UITableViewCell (UITableViewCellStyle.Default, null);
                itemsCell.TextLabel.Text = "Items";
                SetupCell (itemsCell);

                laborCell = new UITableViewCell (UITableViewCellStyle.Default, null);
                laborCell.TextLabel.Text = "Labor Hours";
                SetupCell (laborCell);

                expensesCell = new UITableViewCell (UITableViewCellStyle.Default, null);
                expensesCell.TextLabel.Text = "Expenses";
                SetupCell (expensesCell);

                documentsCell = new UITableViewCell (UITableViewCellStyle.Default, null);
                documentsCell.TextLabel.Text = "Documents";
                SetupCell (documentsCell);

                confirmationCell = new UITableViewCell (UITableViewCellStyle.Default, null);
                confirmationCell.TextLabel.Text = "Confirmations";
                SetupCell (confirmationCell);

                historyCell = new UITableViewCell (UITableViewCellStyle.Default, null);
                // TODO: phone call functiality should be implemented first
                // user can't make calls and history page have no sence
                // that's why this section of menu is disabled
                historyCell.UserInteractionEnabled = false;
                historyCell.TextLabel.Text = "History(Coming soon!)";
                SetupCell (historyCell, end: true);
            }
			public TableSource (MenuController controller)
			{
				this.controller = controller;
				assignmentViewModel = ServiceContainer.Resolve<AssignmentViewModel>();

				summaryCell = new UITableViewCell (UITableViewCellStyle.Default, null);
				summaryCell.TextLabel.Text = "Summary";
				SetupCell (summaryCell, start: true);

				mapCell = new UITableViewCell (UITableViewCellStyle.Default, null);
				mapCell.TextLabel.Text = "Map";
				SetupCell (mapCell);

				itemsCell = new UITableViewCell (UITableViewCellStyle.Default, null);
				itemsCell.TextLabel.Text = "Items";
				SetupCell (itemsCell);

				laborCell = new UITableViewCell (UITableViewCellStyle.Default, null);
				laborCell.TextLabel.Text = "Labor Hours";
				SetupCell (laborCell);

				expensesCell = new UITableViewCell (UITableViewCellStyle.Default, null);
				expensesCell.TextLabel.Text = "Expenses";
				SetupCell (expensesCell);

				documentsCell = new UITableViewCell (UITableViewCellStyle.Default, null);
				documentsCell.TextLabel.Text = "Documents";
				SetupCell (documentsCell);

				confirmationCell = new UITableViewCell (UITableViewCellStyle.Default, null);
				confirmationCell.TextLabel.Text = "Confirmations";
				SetupCell (confirmationCell);

				historyCell = new UITableViewCell (UITableViewCellStyle.Default, null);
				historyCell.TextLabel.Text = "History";
				SetupCell (historyCell, end: true);
			}