UniForm is a reflection based form generator for .Net.
Note this project currently only supports WPF.
- Add
UniForm.Core
via nuget to your project. - Add
UniForm.Engine
via nuget to your project. - Add
UniForm.Wpf
via nuget to your project.
Install-Package UniForm.Core
Install-Package UniForm.Engine
Install-Package UniForm.Wpf
public class ExampleCatModel
{
public enum CatFoods { Chicken, Duck, Moth, Mouse, Grasshopper }
[UniFormField(priority: 0)]
public string Name { get; set; } = "Archibald";
[UniFormField(priority: 1)]
public string Occupation { get; set; } = "Lap Warmer";
[UniFormField("Favourite Snack")]
public CatFoods FavouriteSnack { get; set; } = CatFoods.Moth;
[UniFormField("Bio", "A short biography.", type: UniFormFieldTypes.BlobString)]
public string Biography { get; set; } = "Archibald was no ordinary cat. Sure he had 4 legs and a tail, and 12 crooked whiskers which complimented his stubborn eye brows; but his idiosyncratic nature earned him top position in a league of his own.";
}
public class MyViewModel
{
public object ExampleForm { get; } = new ExampleCatModel();
}
<ScrollViewer>
<wpf:UniFormControl Margin="10" Content="{Binding ExampleForm}" />
</ScrollViewer>