public override void ViewDidLoad() { base.ViewDidLoad (); settings = new Settings (); dataSource = new TKDataFormEntityDataSource (); dataSource.SelectedObject = settings; dataSource.AllowPropertySorting = true; dataSource.EntityModel.PropertyWithName ("Title").PropertyIndex = 0; dataSource.EntityModel.PropertyWithName ("Message").PropertyIndex = 1; dataSource.EntityModel.PropertyWithName ("AllowParallaxEffect").PropertyIndex = 2; dataSource.EntityModel.PropertyWithName ("BackgroundStyle").PropertyIndex = 3; dataSource.EntityModel.PropertyWithName ("ActionsLayout").PropertyIndex = 4; dataSource.EntityModel.PropertyWithName ("DismissMode").PropertyIndex = 5; dataSource.EntityModel.PropertyWithName ("DismissDirection").PropertyIndex = 6; dataSource.EntityModel.PropertyWithName ("AnimationDuration").PropertyIndex = 7; dataSource.EntityModel.PropertyWithName ("BackgroundDim").PropertyIndex = 8; dataForm = new TKDataForm (); dataForm.Frame = this.ExampleBounds; dataForm.Delegate = new DataFormDelegate (); this.View.AddSubview (dataForm); dataForm.RegisterEditor (new ObjCRuntime.Class (typeof(TKDataFormSegmentedEditor)), dataSource.EntityModel.PropertyWithName ("ActionsLayout")); dataForm.RegisterEditor (new ObjCRuntime.Class (typeof(TKDataFormSegmentedEditor)), dataSource.EntityModel.PropertyWithName ("BackgroundStyle")); dataForm.RegisterEditor (new ObjCRuntime.Class (typeof(TKDataFormSegmentedEditor)), dataSource.EntityModel.PropertyWithName ("DismissMode")); dataForm.RegisterEditor (new ObjCRuntime.Class (typeof(TKDataFormSegmentedEditor)), dataSource.EntityModel.PropertyWithName ("DismissDirection")); dataForm.CommitMode = TKDataFormCommitMode.Delayed; dataForm.AutoresizingMask = UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleWidth; dataForm.DataSource = dataSource; this.View.BackgroundColor = new UIColor(0.937f, 0.937f, 0.957f, 1.00f); }
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); }