C # WPF SizeChanged event does not update width and height while maximizing

I tried to update my controls when the form size changed using SizeChanged.

It worked perfectly, except when it went into full-screen mode.

I searched for grid events, but could not find any events that occur when the user maximizes the window (exits to full screen).

+4
source share
1 answer

I was able to get the event SizeChangedto 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 the values ​​for windows Heightand Width:

a = 838.4
b = 1550.4

c = 350.4
d = 524.8

+4

Source: https://habr.com/ru/post/1608133/


All Articles