我的行为会根据页面的方向(纵向/横向)更改视觉状态。我有一个ListBox,其ItemTemplate有一些复杂的DataTemplate。是否可以从VisualState的Storyboard更改ItemTemplate?我的XAML业力很低,Blend不允许我这样做(它改变原来的ItemTemplate,它不会添加故事板条目)。
请记住,这适用于Windows Phone 7(因此是Silverlight 3)。
答案 0 :(得分:1)
我可能没有得到答案,因为它太明显了。我告诉过你我的XAML业力很低。这是解决方案。只需将此ObjectAnimationUsingKeyFrame添加到您的故事板:
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(ItemsControl.ItemTemplate)"
Storyboard.TargetName="PartakersListBox">
<DiscreteObjectKeyFrame KeyTime="0"
Value="{StaticResource LandscapePartakerDataTemplate}" />
</ObjectAnimationUsingKeyFrames>
我还没有回到Blend,看模板是否可编辑。将在下面更新。