我在我的通用应用程序中使用了语义缩放控制,semanic缩放的行为在windows phone 8.1中运行良好(单击标题从缩放视图缩小视图并再次单击任何项目以返回放大视图),但它的Windows 8.1地铁我无法通过点击标题从缩放视图缩小视图,但从缩小我可以放大视图。我有很多样本,但每一个我面临同样的问题,我不知道我在做什么错,截图和我的代码在下面。
截图:
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<StackPanel VerticalAlignment="Top">
<SemanticZoom Name="MySemanticZoom" IsZoomedInViewActive="False" IsZoomOutButtonEnabled="True">
<SemanticZoom.ZoomedInView>
<GridView x:Name="MySZ_ZoomedInGridView" ItemsSource="{Binding Source={StaticResource MyCollectionViewSource}}"
SelectionChanged="MySZ_ZoomedInGridView_SelectionChanged" VerticalAlignment="Top">
<GridView.ItemTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding Name}" MinWidth="150" />
</StackPanel>
</DataTemplate>
</GridView.ItemTemplate>
<GridView.GroupStyle>
<GroupStyle>
<GroupStyle.HeaderTemplate>
<DataTemplate>
<Border BorderBrush="White" BorderThickness="1" MinWidth="150">
<TextBlock Text="{Binding Language}" FontSize="22" Margin="10"/>
</Border>
</DataTemplate>
</GroupStyle.HeaderTemplate>
</GroupStyle>
</GridView.GroupStyle>
</GridView>
</SemanticZoom.ZoomedInView>
<SemanticZoom.ZoomedOutView>
<GridView x:Name="MySZ_ZoomedOutGridView" SelectionMode="None" IsItemClickEnabled="True" VerticalAlignment="Top">
<GridView.ItemTemplate>
<DataTemplate>
<Border BorderBrush="White" BorderThickness="1">
<StackPanel Margin="10">
<TextBlock Text="{Binding Group.Language}" FontSize="22" />
<StackPanel Orientation="Horizontal" MinWidth="150">
<TextBlock Text="No. Available: "/>
<TextBlock Text="{Binding Group.Speakers.Count}"/>
</StackPanel>
</StackPanel>
</Border>
</DataTemplate>
</GridView.ItemTemplate>
<GridView.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</GridView.ItemsPanel>
</GridView>
</SemanticZoom.ZoomedOutView>
</SemanticZoom>
<Button Content="Click to change view" x:Name="ChangeViewButton" Click="ChangeViewButton_Click"/>
</StackPanel>
</Grid>
提前致谢:)
答案 0 :(得分:0)
将项目源添加到缩小状态的gridview并以这种方式设置:
<GridView x:Name="MySZ_ZoomedOutGridView" SelectionMode="None" IsItemClickEnabled="True" VerticalAlignment="Top" ItemsSource="{Binding Source={StaticResource MyCollectionViewSource}, Path=CollectionGroups}">