I have a multiscreen application. Then I override the method OnStartup in code-behind of App.xaml as shown:
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
MainWindow mainWindow = new MainWindow ();
Screen s1 = Screen.AllScreens[0];
Rectangle r1 = s1.WorkingArea;
mainWindow.Top = r1.Top;
mainWindow.Left = r1.Left;
mainWindow.Show();
}
But the Window always shows in the screen when the mouse hovers. How can i set the Window to always show in the Main Screen?
I figured out this property WindowStartUpLoacation = "CenterScreen" is the reason. Then i set it to "Manual" and the issue is no longer.