Пример #1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();

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

            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;
        }
Пример #2
0
        public override void ViewDidLoad()
        {
            AddOption("Top Alignment", PrepareTopAlignment);
            AddOption("Left Alignment", PrepareLeftAlignment);
            AddOption("Top Inline Alignment", PrepareTopInlineAlignment);
            AddOption("Table View Layout", PrepareTableLayout);

            base.ViewDidLoad();

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

            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;
        }