Click here to Skip to main content
15,885,309 members
Please Sign up or sign in to vote.
4.50/5 (2 votes)
See more:
I'm interested in giving the user an interface where they can drag and drop elements and connect them together to create a sort of a visual program. (think Grasshopper for Rhino)
Are there any .NET C# APIs that would help me with this project? (ideally freeware and can be used in commercial products)
Thanks!
Posted
Updated 6-May-11 3:55am
v2

This is not a /don't do it/answer, but try approaching it the other way.

I have implimented more than one /configurable/ UI's and the overriding requirement is that sites, rather than users, need to be able to configure the UI. If you start with a server side business and a config driven layout it's pretty not too complex. You need to decide which user controls are to be supported and how the user can configure them. In the real world, having a text file listing fields is the best way and then let the UI decide on the layout.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 6-May-11 12:19pm    
Please see my answer.
--SA
I don't know any library used to accomplish this, but I have done dynamically generated UI in different settings. This is quite feasible but needs thorough architecture.

If I did it right now based on your idea, I would first define a data model if the UI, which is a non-trivial software architecture exercise. The implementation is easier. The model can be expressed in terms of a set of pure data classes and represent a meta2 layer of the model representing the application field. This application field can be as wide and abstract as "UI design", but can be more limited, such as "Robot control UI design". The user data would be an object graph represented by the instances of the data classes and their relationships. This would represent the meta1 layer of the model, a meta-data as such. It would represent an already implemented instance if the UI. And the user of this UI would be working with meta0-data, which is just the data, and with the physical components of the computer system. The meta2 layer in this approach can be hard-coded in some assembly, but the meta1 which defined the shape of one of the possible UI in your system should be persist in the file between run time sessions. The best and non-intrusive way of doing it is using Data Contract.

When the concrete UI is implemented by the user of meta1-data level (a designer of the UI), nothing should be re-compiled. The UI is generated on the fly out of the model. All controls are added based on the content of the data graph.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900