Example #1
0
        private void InitSamples()
        {
            this.controller = new UINavigationController();
            this.monokitSamples = new Samples(this.controller);

            this.window.AddSubview(this.controller.View);

            // setup main index
            this.tableController = new TableViewController(UITableViewStyle.Grouped);
            this.tableController.Title = "MonoKit";
            this.controller.PushViewController(this.tableController, false);
            this.monokitSamples.SetupMainIndexSection(this.tableController.Source);

            this.window.MakeKeyAndVisible();
        }
Example #2
0
        private void InitSamples()
        {
            this.controller = new MyNavigationController();
            this.monokitSamples = new Samples(this.controller);

            // create a new window instance based on the screen size
            this.window = new UIWindow(UIScreen.MainScreen.Bounds);

            // setup main index
            this.tableController = new TableViewController(UITableViewStyle.Grouped);
            this.tableController.Title = "MonoKit";
            this.controller.PushViewController(this.tableController, false);
            this.monokitSamples.SetupMainIndexSection(this.tableController.Source);

            this.window.RootViewController = this.controller;
            this.window.MakeKeyAndVisible();
        }
Example #3
0
        private UIView CreateContentItem3View()
        {
            this.content3Controller = new TableViewController(UITableViewStyle.Plain);
            this.monokitSamples.SetupContent3(this.content3Controller.Source);

            //this.content3Controller.View.BackgroundColor = UIColor.Clear;
            return this.content3Controller.View;
        }
Example #4
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);
        }
Example #5
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);
        }
Example #6
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 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);
        }
Example #7
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);
        }
Example #8
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);
        }
Example #9
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);
        }
Example #10
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);
        }