点击组标题缩小视图缩放视图不适用于Windows 8.1 metro应用程序的语义缩放

时间:2015-07-24 10:30:39

标签: c# windows-8.1 win-universal-app

我在我的通用应用程序中使用了语义缩放控制,semanic缩放的行为在windows phone 8.1中运行良好(单击标题从缩放视图缩小视图并再次单击任何项​​目以返回放大视图),但它的Windows 8.1地铁我无法通过点击标题从缩放视图缩小视图,但从缩小我可以放大视图。我有很多样本,但每一个我面临同样的问题,我不知道我在做什么错,截图和我的代码在下面。

截图:

[Zoom Out View] [2] Zoom In view Xaml代码:

  <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:&#160;"/>
                                            <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>

提前致谢:)

1 个答案:

答案 0 :(得分:0)

将项目源添加到缩小状态的gridview并以这种方式设置:

<GridView x:Name="MySZ_ZoomedOutGridView" SelectionMode="None" IsItemClickEnabled="True" VerticalAlignment="Top" ItemsSource="{Binding Source={StaticResource MyCollectionViewSource}, Path=CollectionGroups}">