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?

  • Tried it - failed. Height = "{Binding RelativeSource = {RelativeSource Self}, Path = ActualWidth}" Width = "{Binding RelativeSource = {RelativeSource Self}, Path = ActualHeight}" - alex91

1 answer 1

I did not look that for parameter ActualHeight. Studio is not, I can not check. In theory

 Height="{Binding ElementName=MainWin, Path=Width}" 

must be in the topmost hierarchy, resulting in an element height value = width value (i.e. will be square). In the book of McDonald there are examples with a bunch.