Click here to Skip to main content
15,881,044 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello,

My requirement is to provide a solution that creates the silverlight UI dynamically based on some metadata, in the form of xml or pulled from the database.For example control type, width, height, regex for validation,text as description, etc

My challenge is to write it in generic way, which works for most of the controls. Wanted some inputs on the approach to do it.

For now, I have taken the approach using XamlReader.Load() which takes the xaml as string. What I feel is, this approach may not result in a good code which would be flexible enough for any changes or maintainable.

I should be able to attach event handlers, perform validations and bind to the source.

Please provide your inputs, even any smallest thought you get in your mind. It may help me to think and figure out the right approach.

Thanks.


[edit]Urgency deleted - OriginalGriff[/edit]
Posted
Updated 14-Nov-13 21:02pm
v4
Comments
OriginalGriff 15-Nov-13 3:02am    
Urgency deleted: It may be urgent to you, but it isn't to us. All that your stressing the urgency does is to make us think you have left it too late, and want us to do it for you. This annoys some people, and can slow a response.
vaishali sah 15-Nov-13 4:02am    
@OriginalGriff: Please excuse if it has annoyed you or anyone, which was never my intention. I'm just looking for a wise help or guidance.
OriginalGriff 15-Nov-13 4:04am    
It's cool - just don't stress your urgency in future! :laugh:
Maciej Los 17-Nov-13 10:28am    
I'm afraid, there is nothing like "general way to create controls at runtime", especially when there is no template (model) for that. You can't do it for any data.

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