I have a simple application that hosts managed DirectX Controlwith WindowsFormsHost. I overridden the drawing methods in Controlto prevent flickering:
protected override void OnPaint(PaintEventArgs e)
{
if (this.Visible == true) { base.OnPaint(e); }
}
protected override void OnPaintBackground(PaintEventArgs e)
{
if (this.Visible == false) { base.OnPaintBackground(e); }
}
There is a timer that periodically cancels managed DirectX Controlso that it is redrawn.
My problem is that when I lock the computer (WIN + L) and then unlock it, the contents of WPF around WindowsFormsHostsometimes sometimes do not become fully colorized. Its various parts are not drawn until I get the window completely out of sight. Any ideas on why WPF won't redo itself?
Sorry if this is too vague to solve the problem, I cannot share more source code.