ItemsControl で Grid を使用すると問題が発生します。これが私のコードです:
<ItemsControl ItemsSource="{Binding Items}" Margin="12,0,0,0">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Image Name="imgCotrol"
Grid.Row="0"
Source="{Binding Image}"
Margin="0,10,0,10"/>
<TextBlock Grid.Row="1"
Name="txtControl"
Text="{Binding Description}"
TextWrapping="Wrap"/>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
ここでの問題は、Grid.RowDefinitions が残りのスペースに影響を与えていないことです。Image コントロールが TextBlock コントロールをオーバーフローする場合があります。ItemTemplate は Grid 行を無視すると思います。ItemsControl の ContentPresenter がこの動作を引き起こしていることをどこかで読みました。どうすればこれを解決できますか?