I have been looking at Prism to host an old Winforms application. This is being used in our migration from Winforms -> WPF in our company. However, I have come across some issues.
In short I have a project outlined like so:
Project Outline
DataManager WPF Project
MEF Module that on Initialize registers a view with the region manager and references the old winforms project - View -- which contains a WPF UserControl and has a WindowsFormsHost which points to the main view of the old winforms project.
DataManager Winforms project Contains an old Module that needs to be intialized with views
Host Contains the shell and bootstrapper - Shell has the main region in which the WPF DataManager View gets injected into.
So the problem I am having is as follows. The old Winforms view loads correctly in the WPF shell via the new WPF view. However, any content added to the view after this does not get updated. I tried adding some buttons to the screen. I also tried clearing all the controls.
Looking around here, I went with the suggestion of listening to the Size Changed event and calling Child.Refresh on the WPFHost, but still this did not work.
Is this a WPF specific issue like discussed here : Does WPF refresh drawing similar to Windows Forms?
Or is it an issue with not refreshing the view in the region manager correctly? WPF, Prism v2, Region in a modal dialog, add region in code behind
Neither of which seem to work!
Perhaps I need to fire a redraw or similar in the winforms control itself? Edit: Calling a Refresh() after updating the UI did not resolve the issue.
Edit 2: Also tried this in the old Winforms (.net 2.0) application and it displayed correctly!