私は次のようなListViewを持っています:
<ListView x:Name="MyList" ItemsSource="{Binding Path=MyItems}">
<ListView.ItemTemplate>
<DataTemplate>
<StackPanel>
<TextBlock x:Name="Title" Text="{Binding Path=TitleCategory}"/>
<TextBlock x:Name="Body" Text="{Binding Path=BodySummary}" Style="{StaticResource BodyTextStyle}"/>
</StackPanel>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
そのTextBlockに適用するBodyTextStyleは、幅を600pxに設定し、FullScreenLandscapeではすべてが正常に表示されます。ただし、SnappedViewに切り替えると、画面幅が狭くなるため、テキストが途切れます。通常、幅は次のように設定します。
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="Body">
<DiscreteObjectKeyFrame KeyTime="0" Value="300"/>
</ObjectAnimationUsingKeyFrames>
ただし、これによりランタイムクラッシュが発生します。これは、参照しているアイテムがItemTemplateにあるためだと思います。SnappedViewに入ったときにListViewのすべてのアイテムの幅を変更する正しい方法は何ですか?