when I make a WPF window, for some reason, I have to manually control the Maxheight of the window. When I set the MaxHeight of the window, click the maximize button, the window has maximized action, but not very close to the screen, there is always a blank of 3-5 pixels. As shown in the following figure:
if you remove the code that manually sets the window Maxheight, the window will snap to the screen normally when the window is maximized.
I would like to ask you how to solve this problem