views:

47

answers:

1

I have an element host with 3 WPF controls. I am placing the element host on a winform. When my application is coming up, the element host is taking few seconds and the winform is getting displayed as a blank screen.

How to fix this? Any ideas are appreciated. Basically, I don't want to display the blank screen as it looks ugly when the application is coming up.

A: 

This strikes me as really strange. I've used an ElementHost before and didn't notice any serious delay in loading child controls.

It would helpful if you could try isolating the problem by replacing your controls with just a single, plain TextBox control. How long does it take to load, then?

My suspicion is that there's actually something in your control logic that is taking a long time to complete and delaying the control loading. If you can figure out what that is and speed it up or make the processing asynchronous (consider using Reactive Extensions) then you'll at least get rid of the black screen. A profiler (Visual Studio or ANTS) would be a huge help in narrowing that down.

hemp