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

            //UI that is required to be setup from code
            assignmentBackground.Image = Theme.AssignmentActive;
            contact.IconImage          = Theme.IconPhone;
            address.IconImage          = Theme.Map;
            priority.TextColor         = UIColor.White;
            priorityBackground.Image   = Theme.NumberBox;
            accept.SetBackgroundImage(Theme.Accept, UIControlState.Normal);
            decline.SetBackgroundImage(Theme.Decline, UIControlState.Normal);

            numberAndDate.TextColor       =
                titleLabel.TextColor      =
                    startAndEnd.TextColor = Theme.LabelColor;

            //Events
            status.StatusChanged += (sender, e) => SaveAssignment();

            status.Completed += (sender, e) =>
            {
                menuViewModel.MenuIndex = SectionIndex.Confirmations;
                assignmentViewModel.SelectedAssignment = status.Assignment;

                var method = Completed;
                if (method != null)
                {
                    Completed(this, EventArgs.Empty);
                }
            };

            //Child controller
            lastChildController   =
                summaryController = ChildViewControllers[0] as SummaryController;
        }
Ejemplo n.º 2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            //UI that is required to be setup from code
            contact.IconImage        = Theme.IconPhone;
            address.IconImage        = Theme.Map;
            priority.TextColor       = UIColor.White;
            priorityBackground.Image = Theme.NumberBox;

            numberAndDate.TextColor       =
                titleLabel.TextColor      =
                    startAndEnd.TextColor = Theme.LabelColor;

            //Events
            status.StatusChanged += (sender, e) => SaveAssignment();

            status.Completed += (sender, e) =>
            {
                menuViewModel.MenuIndex = SectionIndex.Confirmations;
                assignmentViewModel.SelectedAssignment = status.Assignment;

                var method = Completed;
                if (method != null)
                {
                    Completed(this, EventArgs.Empty);
                }
            };

            //Child controller
            lastChildController   =
                summaryController = ChildViewControllers[0] as SummaryController;

            if (Theme.IsiOS7)
            {
                assignmentBackground.Image = Theme.AssignmentGrey;
                priority.Font         = Theme.FontOfSize(18);
                startAndEnd.Font      = Theme.BoldFontOfSize(10);
                startAndEnd.TextColor = UIColor.White;
                accept.SetTitleColor(Theme.GreenColor, UIControlState.Normal);
                decline.SetTitleColor(Theme.RedColor, UIControlState.Normal);
                accept.Font      =
                    decline.Font = Theme.FontOfSize(16);

                //Status dropdown frame
                var frame = status.Frame;
                frame.Width /= 2;
                frame.X     += frame.Width + 9;
                status.Frame = frame;

                //Priority frames
                frame       = priorityBackground.Frame;
                frame.Width = frame.Height;
                priorityBackground.Frame =
                    priority.Frame       = frame;

                //Start and end dates
                frame             = startAndEnd.Frame;
                frame.X          += 4;
                startAndEnd.Frame = frame;

                //Additional box for the start/end date
                frame        = startAndEnd.Frame;
                frame.X     -= 4;
                frame.Y     += 4;
                frame.Width  = 102;
                frame.Height = 16;
                var timeBox = new UIImageView(frame)
                {
                    Image       = Theme.TimeBox,
                    ContentMode = UIViewContentMode.Left,
                };
                assignmentBackground.AddSubview(timeBox);
                assignmentBackground.BringSubviewToFront(startAndEnd);
            }
            else
            {
                assignmentBackground.Image = Theme.AssignmentActive;
                accept.SetBackgroundImage(Theme.Accept, UIControlState.Normal);
                decline.SetBackgroundImage(Theme.Decline, UIControlState.Normal);
            }
        }
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();

			//UI that is required to be setup from code
			contact.IconImage = Theme.IconPhone;
			address.IconImage = Theme.Map;
			priority.TextColor = UIColor.White;
			priorityBackground.Image = Theme.NumberBox;

			numberAndDate.TextColor =
				titleLabel.TextColor =
				startAndEnd.TextColor = Theme.LabelColor;

			//Events
			status.StatusChanged += (sender, e) => SaveAssignment ();

			status.Completed += (sender, e) => 
			{
				menuViewModel.MenuIndex = SectionIndex.Confirmations;
				assignmentViewModel.SelectedAssignment = status.Assignment;

				var method = Completed;
				if (method != null)
					Completed(this, EventArgs.Empty);
			};

			//Child controller
			lastChildController =
				summaryController = ChildViewControllers[0] as SummaryController;

			if (Theme.IsiOS7) {
				assignmentBackground.Image = Theme.AssignmentGrey;
				priority.Font = Theme.FontOfSize (18);
				startAndEnd.Font = Theme.BoldFontOfSize (10);
				startAndEnd.TextColor = UIColor.White;
				accept.SetTitleColor (Theme.GreenColor, UIControlState.Normal);
				decline.SetTitleColor (Theme.RedColor, UIControlState.Normal);
				accept.Font =
					decline.Font = Theme.FontOfSize (16);

				//Status dropdown frame
				var frame = status.Frame;
				frame.Width /= 2;
				frame.X += frame.Width + 9;
				status.Frame = frame;

				//Priority frames
				frame = priorityBackground.Frame;
				frame.Width = frame.Height;
				priorityBackground.Frame =
					priority.Frame = frame;

				//Start and end dates
				frame = startAndEnd.Frame;
				frame.X += 4;
				startAndEnd.Frame = frame;

				//Additional box for the start/end date
				frame = startAndEnd.Frame;
				frame.X -= 4;
				frame.Y += 4;
				frame.Width = 102;
				frame.Height = 16;
				var timeBox = new UIImageView (frame) {
					Image = Theme.TimeBox,
					ContentMode = UIViewContentMode.Left,
				};
				assignmentBackground.AddSubview (timeBox);
				assignmentBackground.BringSubviewToFront (startAndEnd);

			} else {
				assignmentBackground.Image = Theme.AssignmentActive;
				accept.SetBackgroundImage (Theme.Accept, UIControlState.Normal);
				decline.SetBackgroundImage (Theme.Decline, UIControlState.Normal);
			}
		}
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();

			//UI that is required to be setup from code
			assignmentBackground.Image = Theme.AssignmentActive;
			contact.IconImage = Theme.IconPhone;
			address.IconImage = Theme.Map;
			priority.TextColor = UIColor.White;
			priorityBackground.Image = Theme.NumberBox;
			accept.SetBackgroundImage (Theme.Accept, UIControlState.Normal);
			decline.SetBackgroundImage (Theme.Decline, UIControlState.Normal);

			numberAndDate.TextColor =
				titleLabel.TextColor =
				startAndEnd.TextColor = Theme.LabelColor;

			//Events
			status.StatusChanged += (sender, e) => SaveAssignment ();

			status.Completed += (sender, e) => 
			{
				menuViewModel.MenuIndex = SectionIndex.Confirmations;
				assignmentViewModel.SelectedAssignment = status.Assignment;

				var method = Completed;
				if (method != null)
					Completed(this, EventArgs.Empty);
			};

			//Child controller
			lastChildController =
				summaryController = ChildViewControllers[0] as SummaryController;
		}