I would like to create a winform on the client side for interaction with Silverlight 3.0. The basic idea is using the winform browser. I definitely need both the directions of communication. Would it be impossible by using JavaScript as a midware for the interaction or some better ways? Or is there any new features of Silverlight 3.0 supported for this kind of winform application communication? The original one is one the client's browser to run but now I would like to migrate it to the winform application. For the sake of time-saving, please don't mention about the WPF because of the gap between WPF and the Silverlight.
What is your business case? do you REALLY need to do this? I suspect it will be a painful hack. even more time consuming than filling the WPF gap...
I'd rather choose to migrate to WPF in this case.
But if you really want to do it with a WinForm, you can use socket to make WinForm and Silverlight talk to each other. Some key points:
- WinForm must be the socket server.
- Don't forget to create cross domain access policy file
- Check Silverlight's port number for cross domain access policy file and port range for data
Of course Javascript through the embedded browser control is also an option.
Silverlight application can be called from JavaScript and vice versa; similarly WinForm application can call JavaScript hosted in the browser control and vice versa...so technically speaking its possible.
http://msdn.microsoft.com/en-us/library/cc645076(VS.95).aspx shows how to Silverlight application talk to Javascript back and forth and http://msdn.microsoft.com/en-us/library/a0746166.aspx shows how the WinForms application can talk to Javsscript (hosted in the browser control) back and forth.