예제 #1
0
파일: Samples.cs 프로젝트: nagyist/MonoKit
        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 });
        }
예제 #2
0
        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);
        }
예제 #3
0
        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 });
        }
예제 #4
0
        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;
        }
예제 #5
0
        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
            });
        }
예제 #6
0
        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);
        }
예제 #7
0
        public void InitController()
        {
            var section1 = new TableViewSection(this.Source);

            section1.Header = "Right";
            section1.Add(new StringElement("Show Center")
            {
                Command = this.ShowCenter
            });
        }
예제 #8
0
        public void InitController()
        {
            var section1 = new TableViewSection(this.Source);

            section1.Header = "Left (Middle)";
            section1.Add(new StringElement("Open Left")
            {
                Command = this.Hello
            });
        }
예제 #9
0
        public void InitController()
        {
            var section1 = new TableViewSection(this.Source);

            section1.Header = "Bottom";
            section1.Add(new StringElement("Hello")
            {
                Command = this.Hello
            });
        }
예제 #10
0
        public void InitController()
        {
            var section1 = new TableViewSection(this.Source);

            section1.Header = " ";
            section1.Add(new StringElement("Close")
            {
                Command = this.Close
            });
        }
예제 #11
0
        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);
        }
예제 #12
0
        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
            });
        }
예제 #13
0
        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
                });
            }
        }
예제 #14
0
        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);
        }
예제 #15
0
        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
            });
        }
예제 #16
0
        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();
        }
예제 #18
0
        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);
        }
예제 #19
0
        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
            });
        }
예제 #20
0
파일: Samples.cs 프로젝트: TeleginS/MonoKit
        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);
        }
예제 #21
0
파일: Samples.cs 프로젝트: TeleginS/MonoKit
        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);
        }
예제 #22
0
파일: Samples.cs 프로젝트: TeleginS/MonoKit
        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);
        }
예제 #23
0
        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 });
        }
예제 #24
0
 private void LoadDeeds(TableViewSection section, IEnumerable<ScheduledDeedContract> deeds)
 {
     foreach (var deed in deeds)
     {
         section.Add(new StringElement(deed, new Binding("Description")));
     }
 }
예제 #25
0
        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 });
            }
        }
예제 #26
0
        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 });
        }
예제 #27
0
 public void InitController()
 {
     var section1 = new TableViewSection(this.Source);
     section1.Header = "Left (Middle)";
     section1.Add(new StringElement("Open Left") { Command = this.Hello });
 }
예제 #28
0
파일: Samples.cs 프로젝트: TeleginS/MonoKit
        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);
        }
예제 #29
0
파일: Samples.cs 프로젝트: TeleginS/MonoKit
        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);
        }
예제 #30
0
        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);
        }
예제 #31
0
 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 });
 }
예제 #32
0
 public void InitController()
 {
     var section1 = new TableViewSection(this.Source);
     section1.Header = "Right";
     section1.Add(new StringElement("Show Center") { Command = this.ShowCenter });
 }
예제 #33
0
파일: Samples.cs 프로젝트: TeleginS/MonoKit
        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);
        }
예제 #34
0
 public void InitController()
 {
     var section1 = new TableViewSection(this.Source);
     section1.Header = "Something";
     section1.Add(new StringElement("Hello") { Command = this.Hello });
 }
예제 #35
0
파일: Samples.cs 프로젝트: TeleginS/MonoKit
        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);
        }
예제 #36
0
        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 });
            }
        }
예제 #37
0
 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 });
 }