title: Get width and height of Grid one way from XAML (target) to source (property)
body: <p>I have a XAML element (grid) which has it's horizontal and vertical alignment set to "Stretch".</p>
  
  <p>I want to get the width and the height of the grid when it's on the screen and reflect that to my property in my viewmodel (not the property telling the grid how big it should be but the other way around).</p>
  
  <p>I've tried multiple variations of this but none work:</p>
  
  <pre><code>        &lt;Grid Margin="100" Name="mainHMapGrid" Background="Transparent" 
                                    HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                                    Width="{Binding HMapGridWidth, Mode=OneWay,
                                      UpdateSourceTrigger=PropertyChanged}"
                                    Height="{Binding HMapGridHeight, Mode=OneWay,
                                      UpdateSourceTrigger=PropertyChanged}
  
          &lt;Grid Margin="100" Name="mainHMapGrid" Background="Transparent" 
                                    HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                                    Width="{Binding HMapGridWidth, Mode=OneWayToSource,
                                      UpdateSourceTrigger=PropertyChanged}"
                                    Height="{Binding HMapGridHeight, Mode=OneWayToSource,
                                      UpdateSourceTrigger=PropertyChanged}
  
          &lt;Grid Margin="100" Name="mainHMapGrid" Background="Transparent" 
                                    HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                                    Width="{Binding HMapGridWidth, Mode=TwoWay,
                                      UpdateSourceTrigger=PropertyChanged}"
                                    Height="{Binding HMapGridHeight, Mode=TwoWay,
                                      UpdateSourceTrigger=PropertyChanged}
  </code></pre>
  
  <p>What am I missing?...</p>