1

我了解语义缩放控件基本上是通过这种方式在 XAML 中实现的:

<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>

</SemanticZoom>

我感到困惑的是,假设我有一个“开始”或“主”页面,上面有六个 Gridview,每个 Gridview 在“放大”以查看其详细信息时都会单独显示,我是否需要一个语义缩放来处理整个 GridView 集合,或者我是否需要为每个 GridView 提供语义缩放控件?

如果我只需要一个语义缩放控件来处理所有这些(根据定义,缩小视图实际上对所有这些控件都是相同的),我如何制作特定于所选 GridView 的放大/详细视图?

IOW,如果我有六个包含以下信息的 GridView:

Green Bay Packers
Milwaukee Bucks
Baltimore Orioles
Rory Gallagher
Mark Twain
Abraham Lincoln

...我如何看到当放大/详细视图被激活,并且用户在“马克吐温”网格上“捏出”时,显示马克吐温特定页面?

4

2 回答 2

1

语义缩放最适用于绑定到分组集合源的 GridView。放大和缩小视图仅支持 GridView 或 ListView 作为其子元素,因此如果您有 6 个组,则可以使用单个网格视图来实现。

在缩小视图方面,可以使用相同类型的控件来表示组。可以自定义此视图以显示您需要的信息 - 例如,某个部分中的书籍数量或该部分的概述。

Handling the transition from the zoomed out view to zoomed in is easy enough, if a little convoluted in terms of setting up the binding (IIRC you need to specify the zoomed out binding in code) but moving in the other direction is not guaranteed to behave as you want it to. If the zoomed out view is only one screen wide, for example, then it doesn't make sense to try to scroll to the previously selected group.

I am not in front of my dev machine right now so I'm afraid I can't put a sample together for you, but there are lots of examples online.

于 2012-10-23T20:18:07.503 回答
1

I believe you just need one Semantic Zoom control. But instead of having six different gridviews, can't you just have one bound to a grouped collection? And then your GridView can use an ItemTemplateSelector to display your different data types.

See here for itemtemplateselector: http://blogs.u2u.be/diederik/post/2012/05/22/Using-Dynamic-XAML-in-Windows-8-Metro.aspx

I can provide some code if needed.

And regarding making sure the correct GridView is selected, the semantic zoom control handles that for you.

于 2012-10-23T20:45:51.537 回答