2011-07-13 10 views
0

scrollViewer/Listboxのスクロールアップ/ダウンまたは左/右イベントの取得方法は?私はXAMLに従っています。私はユーザーがスクロールするときに通知を受けたいと思います。wp7のscrollviewer/listboxのスクロールアップ/ダウンまたは左/右のイベントの取得方法

<ScrollViewer HorizontalScrollBarVisibility="Auto" Margin="0,6,-196,0" Height="Auto" Name="imageScroll"> 
    <ListBox x:Name="myListBox" Margin="12,0,0,0"> 
     <ListBox.ItemsPanel> 
      <ItemsPanelTemplate> 
       <StackPanel Orientation ="Horizontal" > 
        <StackPanel.RenderTransform> 
         <TranslateTransform X="0" /> 
        </StackPanel.RenderTransform> 

       </StackPanel> 
      </ItemsPanelTemplate> 
     </ListBox.ItemsPanel> 
     <ListBox.ItemTemplate> 
      <DataTemplate> 
       <StackPanel Orientation="Horizontal"> 
        <TextBlock Foreground="GreenYellow" FontSize="60" Text="{Binding name}"/> 
        <HyperlinkButton Content="EVTEN" NavigateUri="{Binding price}" Foreground="AliceBlue" FontSize="40" TextOptions.TextHintingMode="Animated"/> 
        <TextBlock Foreground="Red" Padding="30" FontSize="60" Text="{Binding price}"/> 
        <TextBlock Foreground="GreenYellow" FontSize="60" Text="{Binding description}"/> 
        <TextBlock Foreground="Red" Padding="30" FontSize="60" Text="{Binding calories}"/> 
       </StackPanel> 
      </DataTemplate> 
     </ListBox.ItemTemplate> 
    </ListBox> 
</ScrollViewer> 

答えて

0

Peter Torrにはexcelent blog postがあり、LazyListBoxを作成する方法を示しています。そのコードは、ScrollViewerの基礎となるリストボックスのVisualStateGroupの変更を検出することによってリストボックスがスクロールされているかどうかを検出する方法を示しています。

+0

を含むようにように見えるが、それは私の仕事をしていません。ありがとう! – masiboo

0

をリストボックスに追加すると、上/下にスクロールできます。

それは私のコード、希望のヘルプはあなたが左右にスクロール

<ListBox x:Name="myListBox" Margin="12,0,0,0"> 
    <ListBox.ItemsPanel> 
     <ItemsPanelTemplate> 
      <StackPanel Orientation ="Horizontal" > 

      </StackPanel> 

      <!-- You can add item contain here --> 
     </ItemsPanelTemplate> 
    </ListBox.ItemsPanel> 

項目はLazyListBoxが複雑ビット間違った場所

関連する問題