WinRT 8.1 Phone - ListView reordering
Posted
by
Jan Kratochvil
on Stack Overflow
See other posts from Stack Overflow
or by Jan Kratochvil
Published on 2014-05-26T18:26:08Z
Indexed on
2014/05/26
21:26 UTC
Read the original article
Hit count: 211
I need to create a reorderable ListView in a Windows Phone 8.1 app created using WinRT. The XAML is the following (it binds to an ObservableDictionary in the codebehind):
<Grid Margin="24">
<ListView x:Name="MainListView" CanDragItems="True" CanReorderItems="True" AllowDrop="True" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" >
<ListView.ItemTemplate>
<DataTemplate>
<Border Padding="24" Margin="16" Background="CadetBlue">
<TextBlock Text="{Binding}" />
</Border>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</Grid>
The ListView does nothing when I try to reorder the items (it looks like the "reordering mode" is not activated).
When I run this sample in Windows 8.1 (the XAML is shared) it works as expected. According to the documentation Windows Phone 8.1 should be supported.
Is this functionality supported on the phone (and the documentation wrong) or do I need to do something special for the phone?
© Stack Overflow or respective owner