Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Automatic gui generation in c#

Is there any library or automatic way to generate a GUI in C# from an arbitrary structure?

For example if I have a class hierarchy I can express it in XML by adding attributes like [XmlAttribute("depth")] or [XmlElement("node")] and passing it to an XML serializer. Can I used different annotations then send it to some GUI construction class to get a form built?

As another example for those who have used BlueJ for java, it provides access to classes and their members in a gui environment (though it has access to the source).

like image 508
Daniel Avatar asked Oct 13 '10 01:10

Daniel


4 Answers

This is why XAML exists. XAML is an XML Markup Language for GUIs and it's parsed by the XAML Parser into UI objects like Window, Button, Image, etc.

XAML is the XML GUI syntax used by WPF (Windows Presentation Foundation) and Silverlight.

like image 110
Jay Avatar answered Nov 18 '22 22:11

Jay


Something like this?

Using XML To Dynamically Generate GUI Elements
http://www.codeproject.com/KB/cs/aal-5a.aspx

like image 2
Robert Harvey Avatar answered Nov 18 '22 22:11

Robert Harvey


It is crude, but sometimes it does it's job. Use a PropertyGrid to view/edit up your classes. So you go from XML to classes via serialization and the view in a form using a property grid.

like image 2
John Alexiou Avatar answered Nov 18 '22 23:11

John Alexiou


I haven't used it bit there's a port of Naked Objects for .Net, written about in this InfoQ article and in this podcast. I think that's the best match for what you're talking about. I've written my own code generator to create XAML and C# from an XML spec but I think you want a dynamic solution.

like image 1
Andy Dent Avatar answered Nov 18 '22 22:11

Andy Dent