2012-04-26 54 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