locked
XAML - ListView DoubleTapped Catastrophic failure RRS feed

  • Question

  • Hi

    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.

    Thursday, February 6, 2014 7:13 AM

Answers

  • Hi ForgottenExile,

    Sorry, I cannot reproduce the issue you are facing, everything just works fine by your code, I double clicked on item5 and item6, the listview rebind with 4 items without any catastrophic failure.

    Could you validate this again on another machine or create a new project for testing this issue?

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.



    Thursday, February 6, 2014 8:53 AM
    Moderator