6
votes

I was trying to update my controls when the size of the form changed using SizeChanged.

It worked perfectly, except when going full screen.

I searched the grid events but couldn't find any events that occur when the user maximizes the window (goes full screen).

1
According to the documentation, When the WindowState property is changed, StateChanged is raised. And indeed it does. - Ivan Stoev
@IvanStoev it does but it doesn't help me because i need it as a event , this will make me put a timer or something so can check weather it has changed or not - Mohammed Khalil

1 Answers

8
votes

I was able to receive SizeChanged event on maximize:

private void window1_SizeChanged(object sender, SizeChangedEventArgs e)
{
    var a = window1.ActualHeight;
    var b = window1.ActualWidth;
    var c = window1.Height;
    var d = window1.Width;
}

And these are values for window Height and Width:

a = 838.4
b = 1550.4
c = 350.4
d = 524.8