An odd behavior is occurring when trying to set the Height of a Grid Row that is inside a ListView on Xamarin.Forms. When I hard code the value, for example:
<RowDefinition Height="40" />
... the Height of the Row gets set to 40. I know because I've tried different values and the Height changed proportionally.
However when I set the same property by binding it to a property on the View Model, no matter what the value of the property is, the Height of the Row always remains the same.
<RowDefinition Height="{Binding SmallImageHeight}" />
Here is the XAML code on my View:
<ListView ItemsSource="{Binding Items}" HasUnevenRows="True" x:Name="itemsListView">
...
<StackLayout>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="{Binding SmallImageHeight}" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="5*" />
<ColumnDefinition Width="5*" />
</Grid.ColumnDefinitions>
<Image Source="{Binding SmallImagePath}"
Aspect="AspectFill"
Grid.Row="0"
Grid.Column="0" />
<StackLayout Grid.Row="0" Grid.Column="1" >
...
</StackLayout>
</Grid>
</StackLayout>
...
</ListView>
I already tested the property on the view model by binding the height to an image outside the ListView and it works. Does anybody know why thins happens and how to fix it?