Ejemplo n.º 1
0
        public static IUEConfig <T> Config <T>() where T : TestClassBase
        {
            var entity = new UEConfig <T>();

            entity.SetName(x => x.Name);

            entity.AddTab("Profile", tab =>
            {
                //TODO: Cannot user same property twice

                tab.AddTextBox(x => x.Name, maxChars: 50).Label("My label").Description("My description").Required("^[A-z]{9}$");
                tab.AddTextBox(x => x.Name).Label("My label").Description("Should be readonly").ReadOnly();
                tab.AddTextArea(x => x.Summary).Label("Summary").Description("My short summary").Required();
                tab.AddCheckbox(x => x.Boolean).Label("Active");
                tab.AddDropdown(x => x.Dropdown, new Dictionary <string, string> {
                    { "1", "A" }, { "2", "B" }, { "3", "C" }
                }).Label("Select").Required();
            });

            return(entity);
        }