elementHost repaint problem in MDI application



Hi


I am having a refresh\repaint problem with the ElementHost control. I have
created a Windows Forms MDI application and inserted ElementHost on a child
form with a very simple XAML. When I move a child form out of MDI parent
working area, and then use MDI parent scroll bars to bring it back,
ElementHost located in a child form does not repaint itself and brings back
visual garbage!

Here are simple steps to reproduce my problem:

1). Create Windows Forms project and add a MDIParent form.

2). Add User Control (WPF) named UserControl1.xaml , leave it as is just
with <Grid></Grid> content.



3). Add Windows Form frm_Child, add ElementHost with Dock.Fill and specify
UserControl1.xaml as a child;



4). Use the following code in MDIParent



frm_Child childForm = new frm_Child();

childForm.MdiParent = this;

childForm.Text = "Window " + childFormNumber++;

childForm.Show();



Now, run application and, using pre-generated MDIParent toolbar, create
several child forms, move one out of the MDI working area, and use MDIParent
scrollbars to bring it back. All ElementHosts on all child forms will become
crazy, filled with parts and pieces of a visual garbage.

What am I missing? How can I made ElementHosts repaint correctly?

(I have posted that question on MSDN WPF Forums, but not geting any reply.
http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/6f88715b-b9ca-4d4f-974b-97b334d26347/
Sorry, for duplicating my question).

.



Relevant Pages

  • funny MDI child sizing flash on WinXP
    ... Windows XP. ... When I have the MDI child maximized and hot-key between children, ... it's unmaximized state before maximizing it. ...
    (microsoft.public.win32.programmer.gdi)
  • Re: How to disable Ctrl+F4?
    ... MDI children implement their own protection against user closing. ... Each MDI child has ... prevent the action from killing off MDI child windows in VS05/WinForms ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: MDI applications that act like SDI
    ... parent(from child form) or the child, ... Also I noticed that word automatically places the child forms within the MDI ... have an MDI Parent form where you set the ... > File | New add child windows set the MdiParent property to this MDI Parent ...
    (microsoft.public.dotnet.languages.vb)
  • Re: MDI problems
    ... "There are some behavior differences between MDI forms and single-document ... interface windows in Windows Forms. ... method does not affect the behavior of MDI child forms". ... set the 'Start Position' property of the child form to 'Center Parent', ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Weird Problem: Closing MDI Parent re-directed to MDI Child
    ... I see now why it goes to the child forms first. ... At the MDI form level I handle the Form.Closed event. ... Opening the child form loads some user controls and adds event handlers to ... > I would expect when you close the MDI parent that it will be re-directed ...
    (microsoft.public.dotnet.languages.vb)