2017-04-23 4 views
0

Im ItemsControlのようなリストコンテナをスクロールする方法については、項目をクリックしてドラッグするかわりにScrollViewerを使用しているスクロールバー?スクロールバーの代わりに行アイテムをドラッグしてItemsControlをスクロールすることはできますか

私は周りを見つけましたが、スクロールバーを使用して項目のリストを上下にスクロールするだけの結果しか見つかりませんでした。

答えて

0

あなたが誰かが書いたこの添付ビヘイビアを使用することができます。

使用を次のように:

<Window x:Class="WpfApp17.MainWindow" 
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
     xmlns:system="clr-namespace:System;assembly=mscorlib" 
     xmlns:local="clr-namespace:WpfApp17" 
     mc:Ignorable="d" 
     Title="MainWindow" Height="350" Width="525"> 
    <Grid> 
     <ScrollViewer local:TouchScrolling.IsEnabled="True"> 
     <ItemsControl> 
      <ItemsControl.ItemTemplate> 
       <DataTemplate> 
        <TextBlock Text="{Binding}"/> 
       </DataTemplate> 
      </ItemsControl.ItemTemplate> 
        <system:String>#1</system:String> 
        <system:String>#2</system:String> 
        <system:String>#3</system:String> 
        <system:String>#4</system:String> 
        <system:String>#5</system:String> 
        <system:String>#4</system:String> 
        <system:String>#5</system:String> 
        <system:String>#6</system:String> 
        <system:String>#7</system:String> 
        <system:String>#8</system:String> 
        <system:String>#9</system:String> 
        <system:String>#10</system:String> 
        <system:String>#11</system:String> 
        <system:String>#12</system:String> 
        <system:String>#13</system:String> 
        <system:String>#14</system:String> 
        <system:String>#15</system:String> 
        <system:String>#16</system:String> 
        <system:String>#17</system:String> 
        <system:String>#18</system:String> 
        <system:String>#19</system:String> 
        <system:String>#20</system:String> 
      </ItemsControl> 
     </ScrollViewer> 
    </Grid> 
</Window> 
+0

おかげで私はそれを感謝します! – user1337604

関連する問題