Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

How to scroll listview on dragging of listviewitem in C# WPF App?

$
0
0
<ScrollViewer Template="{StaticResource ScrollViewerControlTemplate}" ><ListView x:Name="AllFunctionView" Background="#1b1b1b" Margin="15,0,15,0" PreviewMouseDown="AllFunctionView_PreviewMouseDown" PreviewMouseMove="AllFunctionView_PreviewMouseMove" PreviewMouseUp="AllFunctionView_PreviewMouseUp"><ListView.ItemTemplate><DataTemplate><DataTemplate.Resources><Style TargetType="{x:Type StackPanel}"><Style.Triggers><DataTrigger Binding="{Binding SubElement}" Value="NoElement"><Setter Property="Visibility" Value="Collapsed"></Setter></DataTrigger></Style.Triggers></Style></DataTemplate.Resources><Border><StackPanel Orientation="Horizontal" Background="#80d3d3d3" Height="30" Width="100" PreviewMouseDown="TextBlock_PreviewMouseDown"><Image Width="20" Height="20" Source="{Binding ImageIcon}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="5,0,0,0"/><TextBlock Margin="5,0,0,0" Text="{Binding SubElement}" TextAlignment="Center" VerticalAlignment="Center"  FontSize="12" Foreground="White"></TextBlock></StackPanel></Border></DataTemplate></ListView.ItemTemplate><ListView.GroupStyle><GroupStyle><GroupStyle.ContainerStyle><Style TargetType="{x:Type GroupItem}"><Setter Property="Template"><Setter.Value><ControlTemplate><Expander IsExpanded="True" Style="{StaticResource ExpanderStyle1}"><Expander.Header><StackPanel Orientation="Horizontal"><!--<Image Height="20" Width="20" Source="{Binding Name, Converter={StaticResource ImageConverter}}" HorizontalAlignment="Left"/>--><TextBlock Text="{Binding Name}" FontWeight="Bold" Foreground="White" VerticalAlignment="Bottom" /></StackPanel></Expander.Header><ItemsPresenter /></Expander></ControlTemplate></Setter.Value></Setter></Style></GroupStyle.ContainerStyle></GroupStyle></ListView.GroupStyle></ListView></ScrollViewer>

I have listview inside scrollviewer.

Want to scroll listview on dragging of listviewitem.

how?


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>