Changing WindowStyle makes window white and freezes window.
Posted: 12 Nov 2019, 14:58
So i hook key events in MainWindow like so:
And after changing the WindowStyle the windows becomes white, and i'm unable to activate it.
It does not crash like programs on Windows, that become mat/white.
It feels like noesis freezes, but no error is spit out.
The same hapens when changing WindowStyle to WindowState;
The end goal here is to go from Window with a border to fullscreen-borderless and the other way around.
Code: Select all
private bool ctrl = false;
private void MainWindow_KeyUp(object sender, KeyEventArgs args)
{
if (args.Key == Key.Escape)
new Messaging.Message(2, "Window", "LogIn"); // sets content of MainWindow to LogInScreen.
if (args.Key == Key.LeftCtrl || args.Key == Key.RightCtrl)
ctrl = true;
if (args.Key == Key.F && ctrl)
{
ctrl = false;
if (this.WindowStyle == WindowStyle.SingleBorderWindow)
this.WindowStyle = WindowStyle.ThreeDBorderWindow;
else
this.WindowStyle = WindowStyle.SingleBorderWindow;;
}
args.Handled = true;
}
It does not crash like programs on Windows, that become mat/white.
It feels like noesis freezes, but no error is spit out.
The same hapens when changing WindowStyle to WindowState;
The end goal here is to go from Window with a border to fullscreen-borderless and the other way around.