Esempio n. 1
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);
        }
Esempio n. 2
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);
        }