I am new to WPF. I have a problem setting the window screen. I have two PCs with different resolution.
I am developing on one PC, but I can not run it on the other PC due to screen resolution.
I tried below code in XAML :
SizeToContent="WidthAndHeight".
I also tried below code:
MainWindow a = new MainWindow();
a.WindowState = WindowState.Maximized;
a.Width = System.Windows.SystemParameters.PrimaryScreenWidth;
a.Height = System.Windows.SystemParameters.PrimaryScreenHeight;
Set in the main window -
HorizontalAlignment="Stretch"and the same thing toVerticalAlignment="Stretch"