I have a WPF application and I need to know how to center the wain window programatically (not in XAML).
I need to be able to do this both at startup and in response
You will have to find this line : Title="MainWindow" Height="450" Width="800"
And you add this line to it : WindowStartupLocation="CenterScreen"
To become this : Title="MainWindow" Height="450" Width="800" WindowStartupLocation="CenterScreen">
Thank me Later ♥