0

我有一个应用程序,它的主页是这样组织的:

网格 (LayoutRoot)

 VisualStateManager                         (FullLandscape, FullPortrait, Filled,  Snap)

 Grid                                       (Back button and page title)

 ScrollViewer                               (FullLandscape View )

     StackPanel                             (Horizontal)

         GridView                           (non grouped GridView)

         GridView                           (grouped GridView)

         GridView                           (non grouped GridView)

         GridView                           (grouped GridView)

         GridView                           (grouped GridView)

 ScrollViewer                               (Snap View)

     Grid

         ListView                           (Vertical)

我的问题是:

  1. 我是否必须为申请中的每个页面提供 SemanticZoom 才能使申请通过认证?

  2. 如果我想为此主页提供 SemanticZoom,我该怎么做?即我在哪里插入 SemanticZoom 控件?

(我阅读了这篇文章:快速入门:添加 SemanticZoom 控件:)

<SemanticZoom.ZoomedOutView>
    <!-- Put the GridView for the zoomed out view here. -->   
</SemanticZoom.ZoomedOutView>

<SemanticZoom.ZoomedInView>
    <!-- Put the GridView for the zoomed in view here. -->       
</SemanticZoom.ZoomedInView>

谢谢, EitanB

4

3 回答 3

3

从上面写的内容中理解您想要实现的目标有点困难,但我会尽力回答您的问题。

1) SemanticZoom 的使用不是通过认证的强制要求。这是一个很好的功能,可以帮助您以一种简洁的方式向用户呈现数据,并且在适当使用时非常酷。但是,这只是一个控制。给我们一些关于您的项目的更多信息,也许我们可以帮助您决定它是否会为应用程序添加额外的东西。轻松开始,稍后再深入细节。

2) 从 MSDN 下载 SemanticZoom 示例并查看代码。基本上它看起来像这样:

<Page.Resources>
    <CollectionViewSource x:Name="cvs2" IsSourceGrouped="true" />
</Page.Resources>

<Grid x:Name="ContentPanel" VerticalAlignment="Top" HorizontalAlignment="Left">
    <SemanticZoom x:Name="semanticZoom" VerticalAlignment="Bottom">
        <SemanticZoom.ZoomedOutView>
            <GridView ScrollViewer.IsHorizontalScrollChainingEnabled="False">
                <GridView.ItemTemplate>
                    <DataTemplate>
                        <TextBlock
                            Text="{Binding Group.Key}"
                            FontFamily="Segoe UI Light"
                            FontSize="24"/>
                    </DataTemplate>
                </GridView.ItemTemplate>
                <GridView.ItemsPanel>
                    <ItemsPanelTemplate>
                        <WrapGrid ItemWidth="75" ItemHeight="75" MaximumRowsOrColumns="1" VerticalChildrenAlignment="Center" />
                    </ItemsPanelTemplate>
                </GridView.ItemsPanel>
                <GridView.ItemContainerStyle>
                    <Style TargetType="GridViewItem">
                        <Setter Property="Margin" Value="4" />
                        <Setter Property="Padding" Value="10" />
                        <Setter Property="BorderBrush" Value="Gray" />
                        <Setter Property="BorderThickness" Value="1" />
                        <Setter Property="HorizontalContentAlignment" Value="Center" />
                        <Setter Property="VerticalContentAlignment" Value="Center" />
                    </Style>
                </GridView.ItemContainerStyle>
            </GridView>
        </SemanticZoom.ZoomedOutView>
        <SemanticZoom.ZoomedInView>
            <GridView ItemsSource="{Binding Source={StaticResource cvs2}}" IsSwipeEnabled="True" ScrollViewer.IsHorizontalScrollChainingEnabled="False">
                <GridView.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal" Margin="10,10,0,0" HorizontalAlignment="Left" Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
                            <Image Source="{Binding Image}" Height="60" Width="60" VerticalAlignment="Center" Margin="0,0,10,0"/>
                            <TextBlock TextWrapping="Wrap" Foreground="{StaticResource ApplicationForegroundThemeBrush}" Width="200" VerticalAlignment="Center" Text="{Binding Title}" HorizontalAlignment="Left" FontFamily="Segoe UI" />
                        </StackPanel>
                    </DataTemplate>
                </GridView.ItemTemplate>
                <GridView.GroupStyle>
                    <GroupStyle>
                        <GroupStyle.HeaderTemplate>
                            <DataTemplate>
                                <TextBlock Text='{Binding Key}' Foreground="{StaticResource ApplicationForegroundThemeBrush}" Margin="5" FontSize="18" FontFamily="Segoe UI Light" />
                            </DataTemplate>
                        </GroupStyle.HeaderTemplate>
                        <GroupStyle.ContainerStyle>
                            <Style TargetType="GroupItem">
                                <Setter Property="Template">
                                    <Setter.Value>
                                        <ControlTemplate TargetType="GroupItem">
                                            <StackPanel Orientation="Vertical">
                                                <ContentPresenter Content="{TemplateBinding Content}" />
                                                <ItemsControl x:Name="ItemsControl" ItemsSource="{Binding GroupItems}" />
                                            </StackPanel>
                                        </ControlTemplate>
                                    </Setter.Value>
                                </Setter>
                            </Style>
                        </GroupStyle.ContainerStyle>
                        <GroupStyle.Panel>
                            <ItemsPanelTemplate>
                                <VariableSizedWrapGrid Orientation="Vertical" MaximumRowsOrColumns="3" />
                            </ItemsPanelTemplate>
                        </GroupStyle.Panel>
                    </GroupStyle>
                </GridView.GroupStyle>
                <GridView.ItemsPanel>
                    <ItemsPanelTemplate>
                        <WrapGrid Orientation="Vertical" MaximumRowsOrColumns="1" />
                    </ItemsPanelTemplate>
                </GridView.ItemsPanel>
                <Button Visibility="Collapsed"/>
            </GridView>
        </SemanticZoom.ZoomedInView>
    </SemanticZoom>
</Grid>

和代码隐藏:

StoreData _storeData = null;

public ScenarioOutput1()
{
   InitializeComponent();
   _storeData = new StoreData();

   List<GroupInfoList<object>> dataCategory = _storeData.GetGroupsByCategory();
   cvs1.Source = dataCategory;
}
于 2012-09-23T17:01:48.437 回答
0

感谢您的回答。

我确实看到了这个例子,这对我来说很清楚。我不清楚的是:我在这一页上有多个 GridView,而不仅仅是示例中的一个。我脑海中的问题是:我应该遵循页面上每个 GridView 的示例代码,还是有办法为将覆盖所有 GridView 的页面执行一次?请看下面的伪代码。

谢谢, EitanB

VisualStateManager(FullLandscape、FullPortrait、Filled、Snap)

网格(后退按钮和页面标题)

ScrollViewer(全横向视图)

 StackPanel                             (Horizontal)

    <SemanticZoom x:Name="semanticZoom1" VerticalAlignment="Bottom">
        <SemanticZoom.ZoomedOutView>
            GridView                           (non grouped GridView)
        </SemanticZoom.ZoomedOutView>

        <SemanticZoom.ZoomedInView>
            GridView                           (non grouped GridView - Semantic Version)
        </SemanticZoom.ZoomedInView>
     </SemanticZoom>


    <SemanticZoom x:Name="semanticZoom2" VerticalAlignment="Bottom">
        <SemanticZoom.ZoomedOutView>
            GridView                           (grouped GridView)
        </SemanticZoom.ZoomedOutView>

        <SemanticZoom.ZoomedInView>
            GridView                           (grouped GridView - Semantic Version)
        </SemanticZoom.ZoomedInView>
     </SemanticZoom>


    <SemanticZoom x:Name="semanticZoom3" VerticalAlignment="Bottom">
        <SemanticZoom.ZoomedOutView>
            GridView                           (non grouped GridView)
        </SemanticZoom.ZoomedOutView>

        <SemanticZoom.ZoomedInView>
            GridView                           (non grouped GridView - Semantic Version)
        </SemanticZoom.ZoomedInView>
     </SemanticZoom>

    <SemanticZoom x:Name="semanticZoom4" VerticalAlignment="Bottom">
        <SemanticZoom.ZoomedOutView>
            GridView                           (grouped GridView)
        </SemanticZoom.ZoomedOutView>

        <SemanticZoom.ZoomedInView>
            GridView                           (grouped GridView - Semantic Version)
        </SemanticZoom.ZoomedInView>
     </SemanticZoom>

    <SemanticZoom x:Name="semanticZoom5" VerticalAlignment="Bottom">
        <SemanticZoom.ZoomedOutView>
            GridView                           (grouped GridView)
        </SemanticZoom.ZoomedOutView>

        <SemanticZoom.ZoomedInView>
            GridView                           (grouped GridView - Semantic Version)
        </SemanticZoom.ZoomedInView>
     </SemanticZoom>

ScrollViewer(快照视图)

 Grid

     ListView                           (Vertical)
于 2012-09-24T02:55:02.050 回答
0

这样做的方法就像我在我的问题中发布的那样,即问题是询问它是否是正确的方法,答案是肯定的。

艾坦B

于 2012-10-24T21:15:52.533 回答