Reputation: 14585
I am working with a non WPF app so I can only create WPF user controls. My work around for this was to just create my windows as usercontrols and then I created a generic winform to host the wpf usercontrol (using ElementHost) to simulate a wpf window.
Everything works fine on my dev machine (WinXP VM) but on clients machines (VM and Physical, both Windows 7) the windows will open once and work fine. However, when he closes them and then reopens them, they are just blank white. The windows are being closed and disposed of after each close (same thing happened even if I left them in memory). Client has to close the application and start it back up again to see the windows again.
I've tried adding refresh calls and what not using the elementhost but nothing is working. Any ideas?! It happens on every window.
Upvotes: 3
Views: 1267
Reputation: 468
Sorry for posting this as an answer as I don't yet have the rights to just comment. But I have some questions or possible directions to look into.
Have you tried seeing what's happening by attaching a debugger? Is it still getting input events, or repaint events, or is it hung? Is your WPF user control even loading when the window reopens? Oh and make sure to break on first chance exceptions as well, perhaps it a WPF+CLR issue and it's not even getting a chance to load again.
Does Spy++ say anything about the child windows that might tell you what is going on?
Oh and does it happen only on his Win 7 box or does it repro elsewhere as well?
Another thing, what happens if you just create a simple user control and do the same thing? Does it repro?
Does it repro if it's just content in the page rather than in a new window?
Try something simple like this article I just found while searching to see if anyone else has had this issue. http://www.switchonthecode.com/tutorials/wpf-tutorial-using-wpf-in-winforms
Upvotes: 3