I have a grid that contains an image in one of its columns. The image itself does not have a width or height, but its size is controlled using the ColumnDefinition set. From this, I would assume that the width and height are actually set on the image controller, but when I try to associate another element with its width and height, it does not work. When debugging, it turns out that the value of Image.Height and Image.Width is NaN. What for?
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="350"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="10"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Grid Grid.Column="0">
<Image x:Name="_image" Source="image.jpg"></Image>
</Grid>
</Grid>
source
share