UWP语义缩放,ListView,VisualState

时间:2016-05-01 04:22:49

标签: template10

<SemanticZoom x:Name="Zoom" > <SemanticZoom.ZoomedInView> <ListView Name="HotelInList" IsItemClickEnabled="False" Style="{StaticResource HotelListViewStyle}" ItemContainerStyle="{StaticResource HotelListItemContainerStyle}" ItemsSource="{Binding Source={StaticResource HotelViewSource}}" ItemTemplate="{StaticResource HotelListItemTemplate}" SelectedItem="{Binding Selected, Mode=TwoWay}" > <Interactivity:Interaction.Behaviors> <Core:EventTriggerBehavior EventName="ItemClick"> <Core:GoToStateAction StateName="DetailVisualState" /> </Core:EventTriggerBehavior> </Interactivity:Interaction.Behaviors> <ListView.GroupStyle>

上面的互动片段不起作用。它会抱怨HotelInList如何不包含一个名为DetailVisualState的视觉状态,暂时省略了它,但它是一个视觉状态,位于根布局网格的一部分

将在SemanticZoom块内嵌套EventTriggerBehavior吗?

1 个答案:

答案 0 :(得分:0)

<Interactivity:Interaction.Behaviors> <Core:EventTriggerBehavior EventName="ItemClick"> <Core:GoToStateAction StateName="DetailVisualState" TargetObject="{Binding ElementName=ThisPage}" /> </Core:EventTriggerBehavior> </Interactivity:Interaction.Behaviors>

其中ThisPage是x:实际页面的名称,它强制交互向下查看资源树,并从可用资源中查找您请求的visualstate。