Bind to Grid Width and Height

image_pdfimage_print


   
       

<Grid xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      Name="grid">
    <StackPanel Orientation="Horizontal"
                HorizontalAlignment="Center"
                VerticalAlignment="Center">
        <TextBlock Text="{Binding ElementName=grid, Path=ActualWidth}" />
        <TextBlock Text=" &amp;#x00D7; " />
        <TextBlock Text="{Binding ElementName=grid, Path=ActualHeight}" />
        <TextBlock Text=" device independent units" />
    </StackPanel>
</Grid>