tags:

views:

348

answers:

2

When switching between windows in my full screen WPF app, if it is the first time the screen has been shown, The monitor will go black momentarily before the windows is displayed. This only happens the first time the window is shown. Is there a way to pre-load each window so this does not happen?

This is what I've tried:

myWindow.Show();
myWindow.Hide();

but there is a visible flicker.

Then I tried:

myWindow.Height = 0;
myWindow.Width = 0;
myWindow.WindowState = WindowState.Normal;
myWindow.Show();
myWindow.Hide();
myWindow.Height = Screen.PrimaryScreen.Bounds.Height;
myWindow.Width = Screen.PrimaryScreen.Bounds.Width;
myWindow.WindowState = WindowState.Maximized;

No flicker, but when I then shown the window it showed itself in a weird state for a split second then updated to display properly.

A: 

I had a similar problem. In the end I created a splash screen and loaded the controls up behind the splash screen in a seperate thread. This stopped the flashing, but made the initail app load longer.

Jay
A: 

Apparently this person asked a clearer question.

http://stackoverflow.com/questions/2364340/how-can-i-avoid-flicker-in-a-wpf-fullscreen-app

Dan Vogel