Is there any plan for bringing the Silverlight data visualization suite to WPF? Anyone using in WinForms or WPF via an embedded browser?
Thanks,
Douglas
I've attached a sample of what I'm talking about, which also uses a self hosted WCF service in the WPF portion of the application for marshalling messages back and forth between the Silverlight content and the wpf content.
When Silverlight needs to pass a message to wpf it uses its wcf client, when WPF needs to send a message to silverlight it notifies silverlight that there is a new message available via the HTML bridge, giving it the ID, and then Silverlight pulls the message down using its WCF client. This way WCF handles all the serialization and communication management for you.
This example is using the DTO pattern to define messages that are sent back and forth. Messages just need to inherit from MessageBase, and they are automatically eligible to be sent back and forth, as long as their contents are serializable by WCF.
If you dont want to use WCF you can perform all the communication via the HTML bridge, you will just have to handle all serialization concerns yourself, etc.
A note of caution with WCF self hosted services: in Vista with UAC turned on, the user will have to be explicitly allowed to host an http service on that communication port. If you anticipate that platform, keep that in mind.
-Graham
This is helpful. Thank you.
I am currently expecting I'll have to begrudgingly use the HTML bridge. But my schedule is far out enough that I was hoping I could defer development a bit and take advantage of a freshly-announced WPF Data Visualization release. : )
I've run a simple experiment here:
Here is the XAML for the wpf application:
And here is the code behind:
Notice it is using the simple expedient of finding the html page in the same directory as the WPF application, if this isn't a secure enough option for you, you could experiment with using a self hosted WCF service to host the silverlight page, but this will obviously require more code ;-)
Here is the xaml for the silverlight application:
There could be some way to suppress that warning, haven't investigated yet, but if you select "Alow Blocked Content" you will get this much better screenshot.
Now if your silverlight content is mostly self contained your story would end here, probably, but if you need to pass complex events back and forth between the silverlight content and the wpf content you will need to be a bit more crafty.
Which will probably involve:
Either way, you will be creating some sort of event proxy for moving events back and forth. Moving large amounts of data back and forth may prove to be an interesting excercise as well.
Oh, Just as a warning, the WPF WebBrowser control will have airspace issues if you were comtemplating doing complex WPF layout around it: http://msdn.microsoft.com/en-us/library/aa970688.aspx
So be sure to consider whether the WebBrowser control fits into the overall layout strategy of the application before even getting into whether you can host your Silverlight content in it.
I want tight integration within a client application .... making the WPF port very interesting. No news to share?