Events take place in the most important element in the window, namely
Height="{Binding ElementName=MainWin, Path=ActualWidth}" Width="{Binding ElementName=MainWin, Path=ActualHeight}"
The goal, reducing the width, decreases and height. What is the problem?