Esempio n. 1
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;
		}
        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;
        }