protected void Page_Load(object sender, EventArgs e)
        {
            modelGenerator.AddSection(new FieldsSection <User>());
            modelGenerator.CreateForm();
            var user = new User()
            {
                FirstName = "Richoard", LastName = "Helm", Role = Role.Administrator, IsMale = true
            };

            modelGenerator.FillWithData(user);
            dynamicPlaceHolder.Controls.Add(modelGenerator);
            var obj = modelGenerator.GetData();
        }
Beispiel #2
0
        private static void OnContentPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            // Side effects.
            try
            {
                var control = (UniFormControl)d;
                var form    = _g.CreateForm(e.NewValue);

                control.FormName        = form?.Name;
                control.FormDescription = form?.Description;
                control.FormFields      = form?.Fields;
            }
            catch (Exception ex)
            {
                // TODO
            }
        }