WPF window pre-loading
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开发者_JAVA技巧 weird state for a split second then updated to display properly.
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.
Apparently this person asked a clearer question.
How can I avoid flicker in a WPF fullscreen app?
精彩评论