Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generic Windows Form Template

I am creating a generic Windows Form that accepts T and uses reflection with custom attributes to create labels and input controls at run-time.

Example:

class GenericForm<T>: Form where T : ICloneable<T>  
{  
}  

Here's a link to a previous question for the form code: SO Question.

This form could accept the following entity class as an example:

class Vehicle: ICloneable<Vehicle>  
{  
    public int Id { get; set; }  
    public int Name { get; set; }  
    public int Description { get; set; }  
}  

As you could imagine, the magic behind the form would use reflection to determine data types, validation criteria, preferred control types to use, etc.

Rather than re-inventing the wheel, I thought it would be worth asking on SO if anyone knows of such frameworks. Needless to say, I'm looking for something simple rather than a bulky framework.

like image 323
Raheel Khan Avatar asked Jan 08 '12 15:01

Raheel Khan


1 Answers

eXpressApp Framework (XAF) can generate UI on the fly. In a simple case, a programmer will create business entities only, and will not care of UI at all.

like image 53
Uranus Avatar answered Sep 27 '22 21:09

Uranus