Reputation: 443
i need open in all work area
this.Width = SystemParameters.WorkArea.Width;
this.Height = SystemParameters.WorkArea.Height;
but, window not center location in the screen, how i can location my window in center screen?
Upvotes: 1
Views: 1494
Reputation: 962
Try this WindowStartupLocation
UPDATED
If I use...
public MainWindow() {
InitializeComponent();
this.Width = SystemParameters.WorkArea.Width;
this.Height = SystemParameters.WorkArea.Height;
this.Top = 0;
this.Left = 0;
}
Without WindowStartupLocation, the window is centered and fills the screen
Upvotes: 0
Reputation: 48558
Use WindowState
In XAML
<Window WindowState="Maximised">
// ...
</Window>
In Code-behind
MyWindow mw = new MyWindow();
mw.WindowState = WindowState.Maximised;
Upvotes: 1