public void SetupMainIndexSection(TableViewSource source) { var section1 = new TableViewSection(source); section1.Header = "MonoKit Sample Index"; section1.Add(new DisclosureElement("Element Samples") { Command = this.GotoElementSamples }); section1.Add(new DisclosureElement("Binding Samples") { Command = this.GotoBindingSamples }); section1.Add(new DisclosureElement("Large Data Sample") { Command = this.GotoLargeDataSample }); section1.Add(new DisclosureElement("Bind to Single Object") { Command = this.GotoBindToSingleObject }); var section2 = new TableViewSection(source); section2.Header = "Test Samples"; section2.Add(new DisclosureElement("Tasks Test") { Command = this.DoTaskTest }); section2.Add(new DisclosureElement("Snapshot Domain Test") { Command = this.DoDomainTest2 }); section2.Add(new DisclosureElement("Event Sourced Domain Test") { Command = this.DoDomainTest1 }); section2.Add(new DisclosureElement("SQLite Admin Test") { Command = this.DoSqliteTest }); section2.Add(new DisclosureElement("Custom Control") { Command = this.GotoCustomControl }); section2.Add(new DisclosureElement("GC Tests") { Command = this.GotoGCTests }); var section3 = new TableViewSection(source); section3.Header = "Utils"; section3.Add(new StringElement("GC.Collect") { Command = this.DoGCCollect }); }
protected void DoDomainTest2(Element element) { var tb = new TableViewController(UITableViewStyle.Grouped); tb.Title = "Snapshot Sourced"; var section1 = new TableViewSection(tb.Source); section1.Header = "commands"; section1.Add(new StringElement("Test Command 1") { Command = (x) => SnapshotSamples.DoTest1() }); section1.Add(new StringElement("Test Command 2") { Command = (x) => SnapshotSamples.DoTest2() }); var adminSection = new TableViewSection(tb.Source); adminSection.Header = "Sql"; adminSection.Add(new StringElement("Browse") { Command = (x) => { var admin = new SQLite.MonoTouchAdmin.SQLiteAdmin(SnapshotSourcedDB.Main); this.rootController.PushViewController(admin.NewTablesViewController(), true); } }); this.rootController.PushViewController(tb, true); }
public override void LoadView() { base.LoadView(); var section1 = new TableViewSection(this.Source); section1.Add(new StringElement("cash") { Command = this.NavigateToMinion }); section1.Add(new StringElement("banked") { Command = this.NavigateToMinion }); }
public override void LoadView() { base.LoadView(); var section1 = new TableViewSection(this.Source); section1.Add(new StringElement("today 1") { Command = this.NavigateToMinionToday }); section1.Add(new StringElement("today 2") { Command = this.NavigateToMinionToday }); section1.Add(new StringElement("today 3") { Command = this.NavigateToMinionToday }); section1.Add(new StringElement("today 4") { Command = this.NavigateToMinionToday }); this.View.Layer.CornerRadius = 10; }
public void InitSample() { var section1 = new TableViewSection(this.Source); section1.Add(new StringElement("test") { Command = this.DoTest }); section1.Add(new StringElement("add") { Command = this.DoAdd }); }
protected void GotoBindingSamples(Element element) { var tb = new TableViewController(UITableViewStyle.Grouped); tb.Title = "Binding Samples"; var section1 = new TableViewSection(tb.Source); section1.Header = "Same element"; section1.Footer = "Note that both elements update"; var boolElement = new BooleanElement("Bool Value", false); section1.Add(boolElement); section1.Add(boolElement); this.rootController.PushViewController(tb, true); }
public void InitController() { var section1 = new TableViewSection(this.Source); section1.Header = "Right"; section1.Add(new StringElement("Show Center") { Command = this.ShowCenter }); }
public void InitController() { var section1 = new TableViewSection(this.Source); section1.Header = "Left (Middle)"; section1.Add(new StringElement("Open Left") { Command = this.Hello }); }
public void InitController() { var section1 = new TableViewSection(this.Source); section1.Header = "Bottom"; section1.Add(new StringElement("Hello") { Command = this.Hello }); }
public void InitController() { var section1 = new TableViewSection(this.Source); section1.Header = " "; section1.Add(new StringElement("Close") { Command = this.Close }); }
protected void GotoBindToSingleObject(Element element) { var tb = new TableViewController(UITableViewStyle.Grouped); tb.Title = "Single Object Binding Sample"; var section1 = new TableViewSection(tb.Source); section1.Add(new TextInputElement(this.bindToSingleObjectPersion, null, new Binding("FirstName")) { Placeholder = "First Name" }); section1.Add(new TextInputElement(this.bindToSingleObjectPersion, null, new Binding("LastName")) { Placeholder = "Last Name" }); section1.Add(new DateInputElement(this.bindToSingleObjectPersion, null, new Binding("Birthdate"))); this.rootController.PushViewController(tb, true); }
public void InitSample() { var section1 = new TableViewSection(this.Source); section1.Add(new StringElement("Simple") { Command = this.StartSimpleSample }); section1.Add(new StringElement("Navigation (Contained)") { Command = this.StartContainedSample }); section1.Add(new StringElement("Navigation (Integrated)") { Command = this.StartIntegratedSample }); section1.Add(new StringElement("Multi-Deck") { Command = this.StartMultiDeckSample }); }
public void InitController() { if (this.addCloseButton) { var section1 = new TableViewSection(this.Source); section1.Add(new StringElement("Close") { Command = this.Close }); } var section2 = new TableViewSection(this.Source); section2.Add(new StringElement("Open Left") { Command = this.OpenLeft }); section2.Add(new StringElement("Open Right") { Command = this.OpenRight }); var section3 = new TableViewSection(this.Source); section3.Add(new StringElement("Swap Left & Right") { Command = this.Swap }); // for navigation sample if (this.NavigationController != null) { var section4 = new TableViewSection(this.Source); section4.Add(new StringElement("Some other controller") { Command = this.GoNext }); } }
protected void GotoGCTests(Element element) { var tb = new TableViewController(UITableViewStyle.Grouped); tb.Title = "GC Tests"; var section1 = new TableViewSection(tb.Source); section1.Add(new StringElement("Self Referencing Items") { Command = this.SelfReferencingItemsTest }); this.rootController.PushViewController(tb, true); }
public void InitController() { var section1 = new TableViewSection(this.Source); section1.Header = "Center (Top)"; section1.Add(new StringElement("Close") { Command = this.Close }); var section2 = new TableViewSection(this.Source); section2.Add(new StringElement("Open Left") { Command = this.Hello }); }
protected void GotoLargeDataSample(Element element) { var tb = new TableViewController(UITableViewStyle.Grouped); tb.Title = "Large Data Sample"; var section1 = new TableViewSection(tb.Source); section1.Header = "1000 Items"; for (int i = 0; i < 1000; i++) { section1.Add(new StringElement("String Element " + i.ToString())); } this.rootController.PushViewController(tb, true); }
public void Load(MinionContract minion) { this.minion = minion; this.NavigationItem.Title = minion.MinionName ?? "New Minion"; var section1 = new TableViewSection(this.Source); section1.Header = "Minion Name"; section1.BeginUpdate(); section1.Add(new TextInputElement(minion, null, new Binding("MinionName")) { Placeholder = "Name", CanEdit = (_) => false }); section1.EndUpdate(); var section2 = new TableViewSection(this.Source); section2.Header = "Weekly Allowance"; section2.BeginUpdate(); section2.Add(new DecimalInputElement(minion, null, new Binding("WeeklyAllowance")) { CanEdit = (_) => true }); section2.EndUpdate(); }
protected void GotoCustomControl(Element element) { var tb = new TableViewController(UITableViewStyle.Grouped); tb.Title = "Custom Control"; var section1 = new TableViewSection(tb.Source); section1.Header = "Custom Control"; var view = new UIViewDefinition <CustomElementTableViewCell, StringElement>(DefaultElementViewDefintions.SimpleElementBinding) { Param = UITableViewCellStyle.Default }; var customData = new StringElement(""); var wrapper = new ElementDataViewWrapper(view, customData); section1.Add(wrapper); this.rootController.PushViewController(tb, true); }
protected void GotoGCTests(Element element) { var tb = new TableViewController(UITableViewStyle.Grouped); tb.Title = "GC Tests"; var section1 = new TableViewSection(tb.Source); section1.Add(new StringElement("Self Referencing Items"){ Command = this.SelfReferencingItemsTest}); this.rootController.PushViewController(tb, true); }
protected void GotoElementSamples(Element element) { var tb = new TableViewController(UITableViewStyle.Grouped); tb.Title = "Element Samples"; var section = new TableViewSection(tb.Source); section.Header = "Sample Elements"; section.Add(new StringElement("String")); section.Add(new SubtitleStringElement("Subtitle String", "Subtitle")); section.Add(new Value1StringElement("Value1 String", "Detail")); section.Add(new Value2StringElement("Value2 String", "Detail")); section.Add(new BooleanElement("Boolean", true)); section.Add(new CheckboxElement("Checkbox", true)); section.Add(new TextInputElement("Text Input", "") {Placeholder = "Placeholder text" }); section.Add(new PasswordInputElement("Password")); section.Add(new DateInputElement("Date", DateTime.Today)); // Use a DataViewWrapper to wrap an element with a different view definition from the one it would normally get var wrapper = new ElementDataViewWrapper(DefaultElementViewDefintions.DisclosureElementViewDefintion, new StringElement("Wrapped String")); section.Add(wrapper); this.rootController.PushViewController(tb, true); }
private void LoadDeeds(TableViewSection section, IEnumerable<ScheduledDeedContract> deeds) { foreach (var deed in deeds) { section.Add(new StringElement(deed, new Binding("Description"))); } }
public void InitController() { var section1 = new TableViewSection(this.Source); section1.Header = ""; section1.Add(new StringElement("Close") { Command = this.Close }); var section2 = new TableViewSection(this.Source); section2.Header = ""; section2.Add(new StringElement("Go to Deck") { Command = this.GotoDeck }); }
protected void GotoBindToSingleObject(Element element) { var tb = new TableViewController(UITableViewStyle.Grouped); tb.Title = "Single Object Binding Sample"; var section1 = new TableViewSection(tb.Source); section1.Add(new TextInputElement(this.bindToSingleObjectPersion, null, new Binding("FirstName")) { Placeholder = "First Name" }); section1.Add(new TextInputElement(this.bindToSingleObjectPersion, null, new Binding("LastName")) { Placeholder = "Last Name" }); section1.Add(new DateInputElement(this.bindToSingleObjectPersion, null, new Binding("Birthdate")) ); this.rootController.PushViewController(tb, true); }
protected void GotoCustomControl(Element element) { var tb = new TableViewController(UITableViewStyle.Grouped); tb.Title = "Custom Control"; var section1 = new TableViewSection(tb.Source); section1.Header = "Custom Control"; var view = new UIViewDefinition<CustomElementTableViewCell, StringElement>(DefaultElementViewDefintions.SimpleElementBinding) { Param = UITableViewCellStyle.Default }; var customData = new StringElement(""); var wrapper = new ElementDataViewWrapper(view, customData); section1.Add(wrapper); this.rootController.PushViewController(tb, true); }
protected void GotoElementSamples(Element element) { var tb = new TableViewController(UITableViewStyle.Grouped); tb.Title = "Element Samples"; var section = new TableViewSection(tb.Source); section.Header = "Sample Elements"; section.Add(new ButtonElement("Button")); section.Add(new StringElement("String") { Command = this.UpdateText }); section.Add(new SubtitleStringElement("Subtitle String", "Subtitle")); section.Add(new Value1StringElement("Value1 String", "Detail")); section.Add(new Value2StringElement("Value2 String", "Detail")); section.Add(new BooleanElement("Boolean", true)); section.Add(new CheckboxElement("Checkbox", true)); section.Add(new TextInputElement("Text Input", "") { Placeholder = "Placeholder text" }); section.Add(new PasswordInputElement("Password")); section.Add(new DateInputElement("Date", DateTime.Today)); // Use a DataViewWrapper to wrap an element with a different view definition from the one it would normally get var wrapper = new ElementDataViewWrapper(DefaultElementViewDefintions.DisclosureElementViewDefintion, new StringElement("Wrapped String")); section.Add(wrapper); this.rootController.PushViewController(tb, true); }
public void InitController() { var section1 = new TableViewSection(this.Source); section1.Header = "Something"; section1.Add(new StringElement("Hello") { Command = this.Hello }); }
protected void DoDomainTest2(Element element) { var tb = new TableViewController(UITableViewStyle.Grouped); tb.Title = "Snapshot Sourced"; var section1 = new TableViewSection(tb.Source); section1.Header = "commands"; section1.Add(new StringElement("Test Command 1"){ Command = (x) => SnapshotSamples.DoTest1()}); section1.Add(new StringElement("Test Command 2"){ Command = (x) => SnapshotSamples.DoTest2()}); var adminSection = new TableViewSection(tb.Source); adminSection.Header = "Sql"; adminSection.Add(new StringElement("Browse"){ Command = (x) => { var admin = new SQLite.MonoTouchAdmin.SQLiteAdmin(SnapshotSourcedDB.Main); this.rootController.PushViewController(admin.NewTablesViewController(), true); } }); this.rootController.PushViewController(tb, true); }
private void Load(MinionContract minion) { // bit of a hack, ideally I'd have IEditableObject var isNew = minion == null; this.minion = new MinionContract { Id = !isNew ? minion.Id : Guid.NewGuid(), MinionName = !isNew ? minion.MinionName : "New Minion", WeeklyAllowance = !isNew ? minion.WeeklyAllowance : 0, }; var section1 = new TableViewSection(this.Source); section1.Header = "Name"; section1.Add(new TextInputElement(this.minion, null, new Binding("MinionName")) { Placeholder = "Name", }); var section2 = new TableViewSection(this.Source); section2.Header = "Allowance"; section2.Add(new DecimalInputElement(this.minion, null, new Binding("WeeklyAllowance"))); if (!isNew) { var section3 = new TableViewSection(this.Source); section3.Header = "Deeds"; section3.Add(new DisclosureElement("Deeds to Perform") { Command = this.EditDeeds }); } }