We are in the process of porting existing JS application to the Silverlight. You can imagine application as a some kind of document management application: 1.) Documents are stored as XML documents. 2.) Documents can be of different types. Document types can be added without source code modification (everything is in the DB or FS). - Each document type has different form for editing documents. - Each document type has different form for viewing documents.
Edit and view forms are generated from XML document (and XML schema) using a single XSLT and CSS file. Forms between document types can be very similar or very different. Some may contain bullets, auto-numbering (of some elements), borders, indenting, different font-styles, line breaks..., some may not.
Now, the question :) I am not sure how to port this functionality into the SL. I see two basic options: - to create one universal generator for editing forms, and one universal generator for view forms - to create generator for editing forms, and generator for view forms for each document type (the system which we have now)
For the first option I think that I should "invent" some metadata file which will tell how to generate (style) forms. Because we have to support many different styles I think that this would be like inventing a new CSS.
For the second option I don't know how to create this generators. As I already said, adding a new document type (and new generators) should be done without changing or recompiling the source code, and should be easy as much as it could be (document types are changing daily). We had XSLT in JS, but as far as I know there is no XSLT support in the SL.
And also, I am aware that the generator should probably generate XAML code, not HTML.
We have created a prototype in which we have different generator for each document type. Each generator is stored in different assembly which is then dynamically load into the SL application. But I am afraid that creating this for each document type will be a nightmare.
What do you suggest? Please let me know if you need more info. Thanks!
Cheers!