We have a requirement of running WinForm smart client desktop application in browser. Following article explains how to host a WinForm in WPF browser application (XBAP).
http://www.codeproject.com/Articles/31429/Embedding-a-NET-WinForms-Application-in-an-Interne
But our application is based on Smart Client architecture (Smart Client Software Factory - Guidance Package). So we don't have control over form creation and display. Can anyone share the details of what will be required to host a smart client in WPF browser based application?
Finally got some workaround to achieve this.
Overridden Start method of WindowsFormsApplication class which runs the Shell form. But this leads to another problem of form being disposed. CabApplication.Run method internally calls Start method and then disposes the form, once it is closed. As I am not displaying the form in Start method, it directly goes to dispose.
To overcome this, I have commented dispose call from Run method in SCSF framework and handled in application. I am not sure if making a change in framework is a good idea but it worked for me.
To get the Shell object in XBAP application, I created a method in WinForm application, which returns the Form object. I also used an event in AfterShellCreated to notify XBAP application about Shell creation.
With all these changes, I am able to host smart client in WPF browser based application.
Hope this will help others.