public PatientDetailView()
		{
		    this.BackgroundColor = UIColor.White;
		    
            this.image = new UIImageView();
            this.nameField = this.CreateEditableTextField();
            
            var datePickerPopover = new DatePickerPopover(this);
            datePickerPopover.DatePicker.Mode = UIDatePickerMode.Date;
            datePickerPopover.DatePicker.ValueChanged += (s, e) =>
            {
                this.editingDateOfBirth = (s as UIDatePicker).Date;
                this.UpdateDateOfBirthLabel(this.editingDateOfBirth);
            };
            this.dateOfBirthLabel = CreateLabel(text: "date of birth:");
            this.dateOfBirthField = CreateLabel(tapGestureRecognizer: new UITapGestureRecognizer(
                recognizer =>
                {
                    if (!this.Editable)
                    {
                        return;
                    }

                    datePickerPopover.DatePicker.Date = this.patient.DateOfBirth;
                    datePickerPopover.Show(this.dateOfBirthField);
                }));

            this.AddSubview(this.nameField);
			this.AddSubview(this.dateOfBirthLabel);
			this.AddSubview(this.dateOfBirthField);
			this.AddSubview(this.image);	
		}
Пример #2
0
        public PatientDetailView()
        {
            this.BackgroundColor = UIColor.White;

            this.image     = new UIImageView();
            this.nameField = this.CreateEditableTextField();

            var datePickerPopover = new DatePickerPopover(this);

            datePickerPopover.DatePicker.Mode          = UIDatePickerMode.Date;
            datePickerPopover.DatePicker.ValueChanged += (s, e) =>
            {
                this.editingDateOfBirth = (s as UIDatePicker).Date;
                this.UpdateDateOfBirthLabel(this.editingDateOfBirth);
            };
            this.dateOfBirthLabel = CreateLabel(text: "date of birth:");
            this.dateOfBirthField = CreateLabel(tapGestureRecognizer: new UITapGestureRecognizer(
                                                    recognizer =>
            {
                if (!this.Editable)
                {
                    return;
                }

                datePickerPopover.DatePicker.Date = this.patient.DateOfBirth;
                datePickerPopover.Show(this.dateOfBirthField);
            }));

            this.AddSubview(this.nameField);
            this.AddSubview(this.dateOfBirthLabel);
            this.AddSubview(this.dateOfBirthField);
            this.AddSubview(this.image);
        }