I get a Catastrophic failure when a ListViews ItemSource - ObservableCollection gets loaded with less items, when using a Double Tap event. Now a wrote a very simple example of this, and I still get the same error.
This is a Windows 8.1 Store Application.
Simple Example: If I have 6 items in the listview, and I double tap item number 3. Then the ListView rebinds with 4 items. This works perfect.
But if I double tap item number 5 or 6 I get a Catastrophic failure.
Code:
<ListView x:Name="myListView" DoubleTapped="myListView_DoubleTapped" />
public MainPage()
{
this.InitializeComponent();
List<string> list1 = new List<string>();
list1.Add("item1");
list1.Add("item2");
list1.Add("item3");
list1.Add("item4");
list1.Add("item5");
list1.Add("item6");
myListView.ItemsSource = list1;
}
private void myListView_DoubleTapped(object sender, DoubleTappedRoutedEventArgs e)
{
List<string> list2 = new List<string>();
list2.Add("OterhItem1");
list2.Add("OterhItem2");
list2.Add("OterhItem3");
list2.Add("OterhItem4");
myListView.ItemsSource = list2;
}
Update: I tried the same but with only a Tapped event, and it works fine. So it looks like this only happens with the doubletapped event.