Reputation: 3
I got a listview
<ListView x:Name="TasksListView" Margin="24,10,0,0" Grid.Row="3" Padding="0,0,12,0"
ItemsSource="{Binding Tasks}" ReorderMode="Enabled" IsItemClickEnabled="True"
ItemContainerStyle="{StaticResource TaskItemStyle}"
IsEnabled="{Binding IsLoading, Converter={StaticResource InverseBooleanConverter}}"/>
When I reorder the items the back button navigation fails on first click. It works on second click. When i get a hit on HardwareButtons_BackPressed the reorder mode of the listview seems to be "Disabled". Any ideas as to why this is happening?
Upvotes: 0
Views: 203
Reputation: 29792
It deosn't remove back button behaviour - ListView's reorder mode is designed in such a way, that when you hit the back button, ListView leaves reorder mode.
The problem I think is that you start your ListView with ReorderMode = ListViewReorderMode.Enabled
- so the first time, when you hit the back button it leaves reorder mode, and the next back button press works normaly.
The solution may be to enable reorder mode in some circumstances - for example when user hold's your ListView:
private void List_Hold(object sender, HoldingRoutedEventArgs e)
{
(sender as ListView).ReorderMode = ListViewReorderMode.Enabled;
}
Similar situation you will have with MessageDialog - after you show it, the back button will close it and your back key event won't be fired.
Upvotes: 1