Mega Code Archive

 
Categories / C# / WPF
 

Bind to Grid Width and Height

<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=" &#x00D7; " />         <TextBlock Text="{Binding ElementName=grid, Path=ActualHeight}" />         <TextBlock Text=" device independent units" />     </StackPanel> </Grid>