Unable to drag items from list in my Windows Phone 8.1 application

I am building my first Windows Phone 8.1 application as part of a universal Windows Store application. The desktop / tablet version is completed and stored in the store for several weeks, and it works great. I try and assume as little as possible, as I am creating a version of the phone, and so far I have had reasonable success. However, there is one problem that I just couldn’t get into experimenting with, Stackoverflow or Google: I can’t get items in the ListView for drag and drop.

Here is a snapshot of one of the pages of my application:

New Workout page from Solo Coach app

, ListView . , ; , .

/, , , . , , , .

XAML, ListView. , , (IsSwipeEnabled ), , :

    <ListView x:Name="StepsList" ItemsSource="{Binding Steps}"
              ContainerContentChanging="ItemView_ContainerContentChanging"
              SelectionMode="Single" Drop="StepsList_Drop"
              Tapped="StepsList_Tapped"
              CanDragItems="True" 
              AllowDrop="True"
              ScrollViewer.VerticalScrollBarVisibility="Auto"
              Grid.Row="1" Grid.Column="1"
              DragItemsStarting="StepsList_DragItemsStarting"
              Margin="5,0"
              IsSwipeEnabled="True"
              SelectionChanged="StepsList_SelectionChanged">
        <ListView.ItemContainerStyle>
            <Style TargetType="ListViewItem">
                <Setter Property="HorizontalContentAlignment" Value="Center" />
                <Setter Property="MinWidth" Value="300" />
                <Setter Property="MaxWidth" Value="300" />
                <Setter Property="AllowDrop" Value="True" />
            </Style>
        </ListView.ItemContainerStyle>
        <ListView.ItemTemplate>
            <DataTemplate>
                <local:StepControl Role="StepsSource" Tapped="StepSourceItem_Tapped" />
            </DataTemplate>
        </ListView.ItemTemplate>
    </ListView>

DragItemsStarting, .

+4
2

.

StepsList.ReorderMode =  ListViewReorderMode.Enabled;
+1

MSDN , Windows 8.1.

: , , . Windows 8.1?

0

Source: https://habr.com/ru/post/1547322/


All Articles