Can I create WPF controls by using XSLT to transform XML Data?
If I can’t do that, then maybe I could use a web browser control in a WPF grid to display the controls I create from XSLT (I am doing this in an ASP.NET application, so I am familiar with that process) but, how would I respond to events triggered in the web browser control? (if the user clicks a button, etc)? Could I also do the same thing in a Windows Forms application?
If I can reuse the XSLT and XML from my web application and use it to generate the display in my desktop (stand-alone, disconnected) application then this would be the optitmum situation. I am just not sure if it can be done in a way to allow me to create code to handle the events.
Has anyone seen a tutorial or anything that shows this process. I have been looking for a while, and haven’t seen any demonstration of creating controls using xslt and either adding them to the grid (WPF) the form (Windows Forms App) or the Web Control (both) and will allow me to handle the events generated from the page.
Thanks for any advice you can give.
You can certainly transform XML into XAML, and then use a
XamlReaderto deserialize it into WPF objects.But even I, who have used XSLT for all kinds of things you wouldn’t think it could be used for, wouldn’t do this. WPF already has a template-based mechanism for transforming XML into UIs, through data binding and the
XmlDataProvider. It works really, really well, once you understand it.