2012-04-26 53 views
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不会滚动,也不会对项目点击产生反应。

回答

0

我发现了一个很奇怪的方法来解决这个问题。当我切换SemanticZoom一个ScrollViewer中的ordet像

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

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

比一切正常。任何想法为什么?

0

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

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

P.S.我想你在哪里说ListBox你是指ListView?由于名为ListBox的元素也存在。

+0

是的,我的意思的ListView(我仍然在WP7术语:)这工作,但我不需要在捕捉语义缩放,所以它是相当浪费 – 2012-04-26 15:44:01

+0

嘿确定。后一种方法呢,即。隐藏你的SemanticZoom元素,设置isItemClickEnabled真等。另见http://stackoverflow.com/questions/10332867/the-scrollviewer-does-not-scroll的情况下,帮助 – sdb 2012-04-26 15:47:28

+0

isItemClickEnabled =从一开始真的,但根本不起作用。我找到了一个解决方案:切换SemanticZoom和ScrollViewer的顺序。奇怪,但有效。 – 2012-04-28 10:17:22