This project has moved. For the latest updates, please go here.

Working with Nicenis and Scrollviewer.Panningmode Issue

Oct 9, 2015 at 11:27 PM

Working with Touch Events and PanningMode

This is a great library and works excelent, but i'm running with a problem, I'm working in a Project with Touch Screen Events and i need to work with a list of items but these ones must be draggables. Until here, that's ok. But if i have several items in my list the scrolling is activated and for a pleasant handling i activated the panningmode.

Here is the problem if the panning mode is activated the dragging is disabled and viceversa. If anyone knows a way to handle this issue.

Here is my Code:
<Window
    x:Class="DragSourceSample.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:n="clr-namespace:Nicenis.Windows;assembly=Nicenis"
    Title="MainWindow" Height="500" Width="200" Loaded="Window_Loaded">
<Border BorderBrush="BurlyWood" BorderThickness="1">
            <ScrollViewer Height="358" ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.PanningMode="VerticalOnly">
                <ItemsControl x:Name="itm_Products">
                    <TextBlock Text="Text 1"  n:DragSource.AllowDrag="True" n:DragSource.Data="{Binding Path=Text, RelativeSource={RelativeSource Self}}" n:DragSource.VisualFeedbackOffset="{Binding (n:DragSource.ContactPosition), RelativeSource={RelativeSource Self}}"/>
                    <TextBlock Text="Text 2" n:DragSource.AllowDrag="True" n:DragSource.Data="{Binding Path=Text, RelativeSource={RelativeSource Self}}" n:DragSource.VisualFeedbackOffset="{Binding (n:DragSource.ContactPosition), RelativeSource={RelativeSource Self}}"/>
                    <TextBlock Text="Text 3" n:DragSource.AllowDrag="True" n:DragSource.Data="{Binding Path=Text, RelativeSource={RelativeSource Self}}" n:DragSource.VisualFeedbackOffset="{Binding (n:DragSource.ContactPosition), RelativeSource={RelativeSource Self}}"/>
                    <!--More Items here-->
                </ItemsControl>
            </ScrollViewer>
        </Border>
</Window>