1

我有一个从 VS11 模板创建的分组项目页面。这个页面有一个用于普通视图的 GridView 和一个在页面被捕捉时显示的 ListView。我需要实现语义缩放并且仍然能够捕捉页面。

我尝试移动 GridView SemanticZoom.ZoomedInView 所以我有

    <ScrollViewer x:Name="itemListScrollViewer" ...
       <Listview ...
    </ScrollViewer>

    <SemanticZoom Grid.Row="1"  >
        <SemanticZoom.ZoomedInView>
            <GridView ...
        </SemanticZoom.ZoomedInView>
    </SemanticZoom>

当页面没有被捕捉时,ListView 被隐藏,当页面被捕捉时,gridView 被隐藏。问题在于,在快照视图中,ListBox 不会滚动,也不会对项目点击做出反应。

4

2 回答 2

0

您是否希望快照视图也具有语义缩放?在这些情况下,我所做的是实现两种不同的 SemanticZoom,一种用于横向,一种用于捕捉,然后仅针对当前视觉状态显示正确的一种。所以起点是这样的:

<SemanticZoom x:Name="semanticZoom" Visibility="Visible">
    <SemanticZoom.ZoomedOutView>
        <GridView  ...
    </SemanticZoom.ZoomedOutView>

    <SemanticZoom.ZoomedInView>
        <GridView  ...
    </SemanticZoom.ZoomedInView>
</SemanticZoom>


<SemanticZoom x:Name="semanticZoomSnapped" Visibility="Collapsed">
    <SemanticZoom.ZoomedOutView>
        <ListView ...
    </SemanticZoom.ZoomedOutView>

    <SemanticZoom.ZoomedInView>
        <ListView ...
    </SemanticZoom.ZoomedInView>
</SemanticZoom>

或者,如果您不需要在捕捉模式下进行语义缩放,只需尝试您当前的方法,但尝试隐藏 SemanticZoom 元素而不是其中的 GridView。当然要确保 ListView 的 isItemClickEnabled 设置为 true 等。

PS我想你说ListBox是指ListView?由于还存在一个名为 ListBox 的元素。

于 2012-04-26T15:05:14.360 回答
0

我找到了一种非常奇怪的方法来解决这个问题。当我切换 SemanticZoom 的顺序时,一个 ScrollViewer 就像

<SemanticZoom Grid.Row="1"  >
    <SemanticZoom.ZoomedInView>
        <GridView ...
    </SemanticZoom.ZoomedInView>
</SemanticZoom>

<ScrollViewer x:Name="itemListScrollViewer" ...
   <Listview ...
</ScrollViewer>

比一切正常。知道为什么吗?

于 2012-04-28T10:16:22.940 回答