예제 #1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            this.cardInfo         = new CardInfo();
            this.dataSource       = new TKDataFormEntityDataSourceHelper(this.cardInfo);
            this.dataFormDelegate = new ReadOnlyDataFormDelegate(this);

            dataSource["Edit"].DisplayName        = "Allow Edit";
            dataSource["FirstName"].HintText      = "First Name (Must match card)";
            dataSource["LastName"].HintText       = "Last Name (Must match card)";
            dataSource["CardNumber"].HintText     = "Card number";
            dataSource ["CardNumber"].EditorClass = new Class(typeof(TKDataFormNumberEditor));

            dataSource.AddGroup(" ", new string[] { "Edit" });
            dataSource.AddGroup(" ", new string[] { "FirstName", "LastName", "CardNumber", "ZipCode", "ExpirationDate" });

            foreach (var property in dataSource.Properties)
            {
                property.ReadOnly = property.Name != "Edit";
            }

            TKDataForm form = new TKDataForm(this.View.Bounds);

            form.BackgroundColor  = new UIColor(0.937f, 0.937f, 0.960f, 1.0f);
            form.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
            form.Delegate         = this.dataFormDelegate;
            form.WeakDataSource   = this.dataSource.NativeObject;
            form.GroupSpacing     = 20;
            this.View.AddSubview(form);
        }
예제 #2
0
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();

			this.cardInfo = new CardInfo ();
			this.dataSource = new TKDataFormEntityDataSourceHelper (this.cardInfo);
			this.dataFormDelegate = new ReadOnlyDataFormDelegate (this);

			dataSource["Edit"].DisplayName = "Allow Edit";
			dataSource["FirstName"].HintText = "First Name (Must match card)";
			dataSource["LastName"].HintText = "Last Name (Must match card)";
			dataSource["CardNumber"].HintText = "Card number";

			dataSource.AddGroup (" ", new string[] { "Edit" });
			dataSource.AddGroup (" ", new string[] { "FirstName", "LastName", "CardNumber", "ZipCode", "ExpirationDate" });

			foreach (var property in dataSource.Properties) {
				property.ReadOnly = property.Name != "Edit";
			}

			TKDataForm form = new TKDataForm(this.View.Bounds);
			form.BackgroundColor = new UIColor (0.937f, 0.937f, 0.960f, 1.0f);
			form.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
			form.Delegate = this.dataFormDelegate;
			form.WeakDataSource = this.dataSource.NativeObject;
			form.GroupSpacing = 20;
			this.View.AddSubview(form);
		}
예제 #3
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            this.View.BackgroundColor = UIColor.White;

            this.reservationForm  = new ReservationForm();
            this.dataSource       = new TKDataFormEntityDataSourceHelper(this.reservationForm);
            this.dataFormDelegate = new CustomizationDataFormDelegate();

            NSDateFormatter formatter = new NSDateFormatter();

            formatter.DateFormat = "h:mm a";
            this.dataSource.PropertyWithName("Time").Formatter = formatter;

            this.dataSource["Name"].Image   = new UIImage("guest-name.png");
            this.dataSource["Phone"].Image  = new UIImage("phone.png");
            this.dataSource["Date"].Image   = new UIImage("calendar.png");
            this.dataSource["Time"].Image   = new UIImage("time.png");
            this.dataSource["Guests"].Image = new UIImage("guest-number.png");
            this.dataSource["Table"].Image  = new UIImage("table-number.png");

            this.dataSource["Name"].HintText      = "Name";
            this.dataSource["Name"].ErrorMessage  = @"Please fill in the guest name";
            this.dataSource["Time"].EditorClass   = new ObjCRuntime.Class(typeof(TKDataFormTimePickerEditor));
            this.dataSource["Phone"].EditorClass  = new ObjCRuntime.Class(typeof(CallEditor));
            this.dataSource ["Phone"].HintText    = "Phone";
            this.dataSource["Origin"].EditorClass = new ObjCRuntime.Class(typeof(TKDataFormSegmentedEditor));

            this.dataSource["Guests"].ValuesProvider  = new TKRange(new NSNumber(1), new NSNumber(10));
            this.dataSource["Section"].ValuesProvider = NSArray.FromStrings(new string[] {
                "Section 1",
                "Section 2",
                "Section 3",
                "Section 4"
            });
            this.dataSource["Table"].ValuesProvider  = NSArray.FromStrings(new string[] { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15" });
            this.dataSource["Origin"].ValuesProvider = NSArray.FromStrings(new string[] {
                "phone",
                "in-person",
                "online",
                "other"
            });

            this.dataSource.AddGroup("RESERVATION DETAILS", new string[] { "Name", "Phone", "Date", "Time", "Guests" });
            this.dataSource.AddGroup("TABLE DETAILS", new string[] { "Section", "Table" });
            this.dataSource.AddGroup("ORIGIN", new string[] { "Origin" });

            this.DataForm.BackgroundColor = UIColor.FromPatternImage(new UIImage("wood-pattern.png"));
            this.DataForm.Frame           = new CGRect(0, 0, this.View.Bounds.Size.Width, this.View.Bounds.Size.Height - 66);
            this.DataForm.TintColor       = new UIColor(0.780f, 0.2f, 0.223f, 1.0f);
            this.DataForm.Delegate        = this.dataFormDelegate;
            this.DataForm.WeakDataSource  = this.dataSource.NativeObject;

            btn = new UIButton(new CGRect(0, this.DataForm.Frame.Size.Height, this.View.Bounds.Size.Width, 66));
            btn.SetTitle("Cancel Reservation", UIControlState.Normal);
            btn.SetTitleColor(new UIColor(0.780f, 0.2f, 0.223f, 1.0f), UIControlState.Normal);
            btn.AddTarget(this, new ObjCRuntime.Selector("CancelReservation"), UIControlEvent.TouchUpInside);
            this.View.AddSubview(btn);
        }
예제 #4
0
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();
			AddOption ("Save", CommitDataForm);
			
			// Perform any additional setup after loading the view, typically from a nib.
			this.DataForm = new TKDataForm (this.View.Bounds);
			this.DataForm.AutoresizingMask = UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleWidth;
			this.DataForm.AllowScroll = false;
			dataFormDelegate = new DataFormDelegate ();
			this.DataForm.Delegate = dataFormDelegate;
			this.View.AddSubview (this.DataForm);

			this.DataSource =new TKDataFormEntityDataSourceHelper ("user", "json", (string)null);
			this.DataSource ["name"].Index = 0;
			this.DataSource ["age"].Index = 1;

			this.DataSource ["gender"].ValuesProvider = NSArray.FromStrings (new string[] { "Male", "Female" });
			this.DataSource ["gender"].EditorClass = new Class (typeof(TKDataFormSegmentedEditor));
			this.DataSource ["gender"].Index = 2;
			this.DataSource ["gender"].PickersUseIndexValue = false;

			this.DataSource ["email"].Index = 3;
			this.DataSource ["email"].EditorClass = new Class (typeof(TKDataFormEmailEditor));

			this.DataForm.WeakDataSource = this.DataSource.NativeObject;
			this.DataForm.CommitMode = TKDataFormCommitMode.Manual;

			UIBarButtonItem save = new UIBarButtonItem ("Save", UIBarButtonItemStyle.Done, this, new Selector ("CommitDataForm"));
			this.NavigationItem.RightBarButtonItem = save;
		}
예제 #5
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            this.personalInfo     = new PersonalInfo();
            this.dataSource       = new TKDataFormEntityDataSourceHelper(this.personalInfo);
            this.dataFormDelegate = new GettingStartedDataFormDelegate();

            this.dataSource["Password"].HintText              = "Ask every time";
            this.dataSource ["Password"].EditorClass          = new Class(typeof(TKDataFormPasswordEditor));
            this.dataSource["InfoProtocol"].ValuesProvider    = NSArray.FromStrings(new string[] { "L2TP", "PPTP", "IPSec" });
            this.dataSource["EncryptionLevel"].ValuesProvider = NSArray.FromStrings(new string[] { "FIPS Compliant", "High", "Client Compatible", "Low" });

            this.dataSource.AddGroup(" ", new string[] { "InfoProtocol" });
            this.dataSource.AddGroup(" ", new string[] {
                "Details",
                "Server",
                "Account",
                "Secure",
                "Password",
                "EncryptionLevel",
                "SendAllTraffic"
            });

            this.DataForm.BackgroundColor = new UIColor(0.937f, 0.937f, 0.960f, 1.0f);
            this.DataForm.GroupSpacing    = 20;
            this.DataForm.Delegate        = this.dataFormDelegate;
            this.DataForm.WeakDataSource  = this.dataSource.NativeObject;
        }
예제 #6
0
		public override void ViewDidLoad()
		{
			base.ViewDidLoad ();
		
			this.personalInfo = new PersonalInfo ();
			this.dataSource = new TKDataFormEntityDataSourceHelper (this.personalInfo);
			this.dataFormDelegate = new GettingStartedDataFormDelegate ();

			this.dataSource["Password"].HintText = "Ask every time";
			this.dataSource ["Password"].EditorClass = new Class (typeof(TKDataFormPasswordEditor));
			this.dataSource["InfoProtocol"].ValuesProvider = NSArray.FromStrings(new string[] { "L2TP", "PPTP", "IPSec" });
			this.dataSource["EncryptionLevel"].ValuesProvider = NSArray.FromStrings(new string[] { "FIPS Compliant", "High", "Client Compatible", "Low" });

			this.dataSource.AddGroup(" ", new string[] { "InfoProtocol" });
			this.dataSource.AddGroup (" ", new string[] {
				"Details",
				"Server",
				"Account",
				"Secure",
				"Password",
				"EncryptionLevel",
				"SendAllTraffic"
			});
				
			this.DataForm.BackgroundColor = new UIColor (0.937f, 0.937f, 0.960f, 1.0f);
			this.DataForm.GroupSpacing = 20;
			this.DataForm.Delegate = this.dataFormDelegate;
			this.DataForm.WeakDataSource = this.dataSource.NativeObject;
		}
예제 #7
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            this.info             = new EmployeeInfo();
            this.dataSource       = new TKDataFormEntityDataSourceHelper(this.info);
            this.dataFormDelegate = new CollapsableGroupsDataFormDelegate();

            this.dataForm = new TKDataForm(this.View.Bounds);
            this.dataForm.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
            this.dataForm.BackgroundColor  = new UIColor(0.937f, 0.937f, 0.960f, 1.0f);
            this.dataForm.Delegate         = this.dataFormDelegate;
            this.View.AddSubview(this.dataForm);

            this.dataSource.AddGroup("Personal Info", new string[] {
                "GivenNames",
                "Surname",
                "Gender",
                "IdNumber",
                "DateOfBirth"
            });

            this.dataSource.AddGroup("Contact Info", new string[] { "EmployeeId", "PhoneNumber" });

            this.dataSource ["Gender"].EditorClass    = new Class("TKDataFormSegmentedEditor");
            this.dataSource ["Gender"].ValuesProvider = NSArray.FromStrings(new string[] { "Male", "Female" });

            this.dataSource ["IdNumber"].EditorClass   = new Class("TKDataFormNumberEditor");
            this.dataSource ["EmployeeId"].EditorClass = new Class("TKDataFormNumberEditor");
            this.dataForm.WeakDataSource = this.dataSource.NativeObject;
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();

            this.info = new EmployeeInfo ();
            this.dataSource = new TKDataFormEntityDataSourceHelper (this.info);
            this.dataFormDelegate = new CollapsableGroupsDataFormDelegate ();

            this.dataForm = new TKDataForm (this.View.Bounds);
            this.dataForm.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
            this.dataForm.BackgroundColor = new UIColor (0.937f, 0.937f, 0.960f, 1.0f);
            this.dataForm.Delegate = this.dataFormDelegate;
            this.View.AddSubview (this.dataForm);

            this.dataSource.AddGroup ("Personal Info", new string[] {
                "GivenNames",
                "Surname",
                "Gender",
                "IdNumber",
                "DateOfBirth"
            });

            this.dataSource.AddGroup ("Contact Info", new string[] { "EmployeeId", "PhoneNumber" });

            this.dataSource ["Gender"].EditorClass = new Class ("TKDataFormSegmentedEditor");
            this.dataSource ["Gender"].ValuesProvider = NSArray.FromStrings (new string[] { "Male", "Female" });

            this.dataSource ["IdNumber"].EditorClass = new Class ("TKDataFormNumberEditor");
            this.dataSource ["EmployeeId"].EditorClass = new Class ("TKDataFormNumberEditor");
            this.dataForm.WeakDataSource = this.dataSource.NativeObject;
        }
예제 #9
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            AddOption("Save", CommitDataForm);

            // Perform any additional setup after loading the view, typically from a nib.
            this.DataForm = new TKDataForm(this.View.Bounds);
            this.DataForm.AutoresizingMask = UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleWidth;
            this.DataForm.AllowScroll      = false;
            dataFormDelegate       = new DataFormDelegate();
            this.DataForm.Delegate = dataFormDelegate;
            this.View.AddSubview(this.DataForm);

            this.DataSource = new TKDataFormEntityDataSourceHelper("user", "json", (string)null);
            this.DataSource ["name"].Index = 0;
            this.DataSource ["age"].Index  = 1;

            this.DataSource ["gender"].ValuesProvider       = NSArray.FromStrings(new string[] { "Male", "Female" });
            this.DataSource ["gender"].EditorClass          = new Class(typeof(TKDataFormSegmentedEditor));
            this.DataSource ["gender"].Index                = 2;
            this.DataSource ["gender"].PickersUseIndexValue = false;

            this.DataSource ["email"].Index       = 3;
            this.DataSource ["email"].EditorClass = new Class(typeof(TKDataFormEmailEditor));

            this.DataForm.WeakDataSource = this.DataSource.NativeObject;
            this.DataForm.CommitMode     = TKDataFormCommitMode.Manual;

            UIBarButtonItem save = new UIBarButtonItem("Save", UIBarButtonItemStyle.Done, this, new Selector("CommitDataForm"));

            this.NavigationItem.RightBarButtonItem = save;
        }
예제 #10
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();

            this.View.BackgroundColor = UIColor.White;

            this.reservationForm = new ReservationForm ();
            this.dataSource = new TKDataFormEntityDataSourceHelper (this.reservationForm);
            this.dataFormDelegate = new CustomizationDataFormDelegate ();

            NSDateFormatter formatter = new NSDateFormatter ();
            formatter.DateFormat = "h:mm a";
            this.dataSource.PropertyWithName ("Time").Formatter = formatter;

            this.dataSource["Name"].Image = new UIImage ("guest-name.png");
            this.dataSource["Phone"].Image = new UIImage ("phone.png");
            this.dataSource["Date"].Image = new UIImage ("calendar.png");
            this.dataSource["Time"].Image = new UIImage ("time.png");
            this.dataSource["Guests"].Image = new UIImage ("guest-number.png");
            this.dataSource["Table"].Image = new UIImage ("table-number.png");

            this.dataSource["Name"].HintText = "Name";
            this.dataSource["Name"].ErrorMessage = @"Please fill in the guest name";
            this.dataSource["Time"].EditorClass = new ObjCRuntime.Class(typeof(TKDataFormTimePickerEditor));
            this.dataSource["Phone"].EditorClass = new ObjCRuntime.Class(typeof(CallEditor));
            this.dataSource ["Phone"].HintText = "Phone";
            this.dataSource["Origin"].EditorClass = new ObjCRuntime.Class(typeof(TKDataFormSegmentedEditor));

            this.dataSource["Guests"].ValuesProvider = new TKRange (new NSNumber(1), new NSNumber(10));
            this.dataSource["Section"].ValuesProvider = NSArray.FromStrings (new string[] {
                "Section 1",
                "Section 2",
                "Section 3",
                "Section 4"
            });
            this.dataSource["Table"].ValuesProvider = NSArray.FromStrings(new string[] { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15" });
            this.dataSource["Origin"].ValuesProvider = NSArray.FromStrings (new string[] {
                "phone",
                "in-person",
                "online",
                "other"
            });

            this.dataSource.AddGroup ("RESERVATION DETAILS", new string[] { "Name", "Phone", "Date", "Time", "Guests" });
            this.dataSource.AddGroup ("TABLE DETAILS", new string[] { "Section", "Table" });
            this.dataSource.AddGroup ("ORIGIN", new string[] { "Origin" });

            this.DataForm.BackgroundColor = UIColor.FromPatternImage (new UIImage ("wood-pattern.png"));
            this.DataForm.Frame = new CGRect (0, 0, this.View.Bounds.Size.Width, this.View.Bounds.Size.Height - 66);
            this.DataForm.TintColor = new UIColor (0.780f, 0.2f, 0.223f, 1.0f);
            this.DataForm.Delegate = this.dataFormDelegate;
            this.DataForm.WeakDataSource = this.dataSource.NativeObject;

            btn = new UIButton (new CGRect (0, this.DataForm.Frame.Size.Height, this.View.Bounds.Size.Width, 66));
            btn.SetTitle ("Cancel Reservation", UIControlState.Normal);
            btn.SetTitleColor (new UIColor (0.780f, 0.2f, 0.223f, 1.0f), UIControlState.Normal);
            btn.AddTarget (this, new ObjCRuntime.Selector ("CancelReservation"), UIControlEvent.TouchUpInside);
            this.View.AddSubview (btn);
        }
예제 #11
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            this.registrationInfo   = new RegistrationInfo();
            this.validationDelegate = new ValidationDataFormDelegate(this);
            this.dataSource         = new TKDataFormEntityDataSourceHelper(this.registrationInfo);

            TKEntityProperty emailProperty = this.dataSource["Email"];

            emailProperty.HintText    = "E-mail (Required)";
            emailProperty.EditorClass = new Class(typeof(TKDataFormEmailEditor));
            TKDataFormEmailValidator emailValidator = new TKDataFormEmailValidator();

            emailProperty.Validators = new NSObject[] { emailValidator };

            TKEntityProperty password = this.dataSource.PropertyWithName("Password");

            password.HintText    = "Password";
            password.EditorClass = new Class(typeof(TKDataFormPasswordEditor));

            // >> dataform-password-cs
            TKDataFormMinimumLengthValidator passwordValidator = new TKDataFormMinimumLengthValidator(6);

            passwordValidator.ErrorMessage = "Password must be at least 6 characters!";
            password.Validators            = new NSObject[] { passwordValidator };
            // << dataform-password-cs

            TKEntityProperty repeatPassword = this.dataSource.PropertyWithName("RepeatPassword");

            repeatPassword.HintText     = "Confirm password";
            repeatPassword.EditorClass  = new Class(typeof(TKDataFormPasswordEditor));
            repeatPassword.ErrorMessage = "The password does not match!";

            this.dataSource["Name"].HintText           = "Name (Optional)";
            this.dataSource["Gender"].ValuesProvider   = NSArray.FromStrings(new string[] { "Male", "Female" });
            this.dataSource ["Country"].ValuesProvider = NSArray.FromStrings(new string[] { "Bulgaria", "France", "Germany", "Italy", "United Kingdom" });
            this.dataSource["Country"].EditorClass     = new ObjCRuntime.Class(typeof(TKDataFormPickerViewEditor));

            dataSource.AddGroup("Account", new string[] { "Email", "Password", "RepeatPassword", "RememberMe" });
            dataSource.AddGroup("Details", new string[] { "Name", "DateOfBirth", "Gender", "Country" });

            this.DataForm.BackgroundColor = new UIColor(0.937f, 0.937f, 0.960f, 1.0f);
            this.DataForm.Delegate        = this.validationDelegate;
            this.DataForm.WeakDataSource  = dataSource.NativeObject;
            // >> dataform-validation-cs
            this.DataForm.ValidationMode = TKDataFormValidationMode.Immediate;
            // << dataform-validation-cs
        }
예제 #12
0
        public override void ViewDidLoad()
        {
            this.AddOption("Show Alert", ShowAlert);

            base.ViewDidLoad();

            this.AutomaticallyAdjustsScrollViewInsets = false;

            settings        = new Settings();
            this.dataSource = new TKDataFormEntityDataSourceHelper(settings);

            dataSource["Title"].Index             = 0;
            dataSource["Message"].Index           = 1;
            dataSource["AllowParallax"].Index     = 2;
            dataSource["BackgroundStyle"].Index   = 3;
            dataSource["ActionsLayout"].Index     = 4;
            dataSource["DismissMode"].Index       = 5;
            dataSource["DismissDirection"].Index  = 6;
            dataSource["AnimationDuration"].Index = 7;
            dataSource["BackgroundDim"].Index     = 8;

            dataSource["ActionsLayout"].ValuesProvider    = NSArray.FromObjects(new string[] { "Horizontal", "Vertical" });
            dataSource["BackgroundStyle"].ValuesProvider  = NSArray.FromObjects(new string[] { "Blur", "Dim" });
            dataSource["DismissMode"].ValuesProvider      = NSArray.FromObjects(new string[] { "None", "Tap", "Swipe" });
            dataSource["DismissDirection"].ValuesProvider = NSArray.FromObjects(new string[] { "Horizontal", "Vertical" });

            dataForm = new TKDataForm(this.View.Bounds);
            dataForm.WeakDataSource   = this.dataSource.NativeObject;
            dataForm.CommitMode       = TKDataFormCommitMode.Manual;
            dataForm.AutoresizingMask = UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleWidth;
            this.View.AddSubview(dataForm);

            if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad)
            {
                dataForm.Frame            = this.View.Bounds;
                this.View.BackgroundColor = new UIColor(0.937f, 0.937f, 0.957f, 1.00f);
            }

            this.View.BackgroundColor = new UIColor(0.937f, 0.937f, 0.957f, 1.00f);
        }
예제 #13
0
		public override void ViewDidLoad ()
		{
			this.AddOption ("Show Alert", ShowAlert);

			base.ViewDidLoad ();

			this.AutomaticallyAdjustsScrollViewInsets = false;

			settings = new Settings ();
			this.dataSource = new TKDataFormEntityDataSourceHelper (settings);

			dataSource["Title"].Index = 0;
			dataSource["Message"].Index = 1;
			dataSource["AllowParallax"].Index = 2;
			dataSource["BackgroundStyle"].Index = 3;
			dataSource["ActionsLayout"].Index = 4;
			dataSource["DismissMode"].Index = 5;
			dataSource["DismissDirection"].Index = 6;
			dataSource["AnimationDuration"].Index = 7;
			dataSource["BackgroundDim"].Index = 8;

			dataSource["ActionsLayout"].ValuesProvider = NSArray.FromObjects(new string[] { "Horizontal", "Vertical" });
			dataSource["BackgroundStyle"].ValuesProvider = NSArray.FromObjects(new string[] { "Blur", "Dim" });
			dataSource["DismissMode"].ValuesProvider = NSArray.FromObjects (new string[] { "None", "Tap", "Swipe" });
			dataSource["DismissDirection"].ValuesProvider = NSArray.FromObjects (new string[] { "Horizontal", "Vertical" });

			dataForm = new TKDataForm (this.View.Bounds);
			dataForm.WeakDataSource = this.dataSource.NativeObject;
			dataForm.CommitMode = TKDataFormCommitMode.Manual;
			dataForm.AutoresizingMask = UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleWidth;
			this.View.AddSubview (dataForm);

			if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad) {
				dataForm.Frame = this.View.Bounds;
				this.View.BackgroundColor = new UIColor(0.937f, 0.937f, 0.957f, 1.00f);
			}

			this.View.BackgroundColor = new UIColor(0.937f, 0.937f, 0.957f, 1.00f);
		}
예제 #14
0
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();

			this.registrationInfo = new RegistrationInfo ();
			this.validationDelegate = new ValidationDataFormDelegate (this);
			this.dataSource = new TKDataFormEntityDataSourceHelper (this.registrationInfo);

			TKEntityProperty emailProperty = this.dataSource["Email"];
			emailProperty.HintText = "E-mail (Required)";
			emailProperty.EditorClass = new Class (typeof(TKDataFormEmailEditor));
			emailProperty.Validators = new NSObject[] { new EmailValidator() };

			TKEntityProperty password = this.dataSource.PropertyWithName("Password");
			password.HintText = "Password (Minimum 6 characters)";
			password.EditorClass = new Class (typeof(TKDataFormPasswordEditor));
			password.Validators = new NSObject[] { new PasswordValidator () };

			TKEntityProperty repeatPassword = this.dataSource.PropertyWithName ("RepeatPassword");
			repeatPassword.HintText = "Confirm password";
			repeatPassword.EditorClass = new Class (typeof(TKDataFormPasswordEditor));
			repeatPassword.ErrorMessage = "The password does not match!";

			this.dataSource["Name"].HintText = "Name (Optional)";
			this.dataSource["Gender"].ValuesProvider = NSArray.FromStrings (new string[] { "Male", "Female" });
			this.dataSource ["Country"].ValuesProvider = NSArray.FromStrings (new string[] { "Bulgaria", "France", "Germany", "Italy", "United Kingdom" });
			this.dataSource["Country"].EditorClass = new ObjCRuntime.Class(typeof(TKDataFormPickerViewEditor));

			dataSource.AddGroup ("Account", new string[] { "Email", "Password", "RepeatPassword", "RememberMe" });
			dataSource.AddGroup ("Details", new string[] { "Name", "DateOfBirth", "Gender", "Country" });

			this.DataForm.BackgroundColor = new UIColor (0.937f, 0.937f, 0.960f, 1.0f);
			this.DataForm.Delegate = this.validationDelegate;
			this.DataForm.WeakDataSource = dataSource.NativeObject;
			this.DataForm.ValidationMode = TKDataFormValidationMode.Immediate;
		}