2013-01-24 30 views
1

一個簡單的XAML這樣如何使FlipView滾動只在一個方向

<FlipView> 
    <FlipView> 
     <FlipView.ItemsPanel> 
      <ItemsPanelTemplate> 
       <StackPanel Orientation="Vertical" /> 
      </ItemsPanelTemplate> 
     </FlipView.ItemsPanel> 
     <Rectangle Fill="CornflowerBlue" /> 
     <Rectangle Fill="CornflowerBlue" /> 
    </FlipView> 
    <FlipView> 
     <FlipView.ItemsPanel> 
      <ItemsPanelTemplate> 
       <StackPanel Orientation="Vertical" /> 
      </ItemsPanelTemplate> 
     </FlipView.ItemsPanel> 
     <Rectangle Fill="CornflowerBlue" /> 
     <Rectangle Fill="CornflowerBlue" /> 
    </FlipView> 
    <ListBox> 
     <Rectangle Fill="CornflowerBlue" /> 
     <Rectangle Fill="CornflowerBlue" /> 
    </ListBox> 
</FlipView> 

如果主FlipView目前的項目是flipview,您可以將它的滾動條上的兩個directions.But如果它是一個列表框,只有一個方向可用。在您的手指向上之前,您無法拖動並在另一個方向(Horizental或垂直)上滾動。

那麼如何使flipview的行爲與列表框一樣呢?

回答

2

如果提取從FlipView默認模板,你可以看到風格如何擁有這些setter方法:

<Setter 
    Property="ScrollViewer.IsHorizontalRailEnabled" 
    Value="False" /> 
<Setter 
    Property="ScrollViewer.IsVerticalRailEnabled" 
    Value="False" /> 
<Setter 

從,你可以推斷出你的FlipView設置ScrollViewer.IsHorizontalRailEnabledScrollViewer.IsVerticalRailEnabledTrue你想你問給對於。

+0

是否有任何JavaScript等價於此? –

+0

對不起,我不使用這些。我會問一個單獨的q。 –

相關問題