none
[UWP] RefreshContainer crash on Surface RRS feed

  • Question

  • I'm using the RefreshContainer control to provide a way to refresh a GridView intuitively when touch interacrtions are available such as with a Surface. However, it seems to be crashing intermittently.

    If touch interactions are done slowly, the app works fine with no unhandled exceptions. Otherwise, the app either freezes or crashes.
    The same behaviour is observed in the XAML Controls Gallery.

    The fastest way to reproduce the issue:

    1. Open XAML Controls Gallery
    2. Go to the PullToRefresh page; the one that uses RefreshContainer
    3. Scroll/swipe through the sample list (to ensure it's in focus?)
    4. Just start tapping the list with five fingers

    Alternatively, an app with the following in MainPage.xaml

            <RefreshContainer x:Name="rc" RefreshRequested="Rc_RefreshRequested">
                <GridView x:Name="gv" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
                    <GridView.ItemTemplate>
                        <DataTemplate>
                            <Grid Height="200" Width="200">
                                <TextBlock Text="{Binding}" VerticalAlignment="Center"
                                           HorizontalAlignment="Center"/>
                            </Grid>
                        </DataTemplate>
                    </GridView.ItemTemplate>
                </GridView>
            </RefreshContainer>

    and the following in MainPage.xaml.cs:

            ObservableCollection<string> items;
            protected override async void OnNavigatedTo(NavigationEventArgs e)
            {
                base.OnNavigatedTo(e);
                items = new ObservableCollection<string>();
                await AddItems();
                gv.ItemsSource = items;
            }
            public async Task AddItems()
            {
                await Task.Delay(1000);
                items.Add("one");
                items.Add("two");
                items.Add("three");
                items.Add("four");
                items.Add("five");
                items.Add("six");
                items.Add("seven");
                items.Add("eight");
                items.Add("nine");
                items.Add("ten");
                items.Add("eleven");
                items.Add("twelve");
            }
    
            private async void Rc_RefreshRequested(RefreshContainer sender, RefreshRequestedEventArgs args)
            {
                using (var RefreshCompletionDeferral = args.GetDeferral())
                {
                    await AddItems();
                }
            }

    Run the app on a surface device, do steps 3 and 4 again, and you'll break at App.g.i.cs with the exception: {System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))}

    This issue also arises more easily when a debugger is attached.

    What am I missing here? Why is this happening? What am I being denied access to?

    Monday, February 11, 2019 9:32 AM

All replies

  • Hi,

    I asked another engineer to test about this and he could reproduce this. It happens when the touch happens very quickly.

    I'll confirm this with the team to see if this is not expected. 

    Best regards,

    Roy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, February 12, 2019 7:44 AM
    Moderator
  • Hello Roy,

    Thank you for your response.

    Are there any updates regarding this?

    Thursday, February 14, 2019 7:38 AM
  • Hi,

    I'm sorry to say that I haven't get response from team for this right now. This might take more time for the team to confirm. 

    Best regards,

    Roy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, February 14, 2019 9:54 AM
    Moderator
  • Hi,

    Any updates so far?

    I've had to remove the RefreshContainer entirely as it was the main cause of my app crashing, which is not ideal as the "pull to refresh" interaction is a very natural UX

    Sunday, March 3, 2019 7:32 AM
  • Hi,

    Well, I still haven't get response from the team. You could try to create a custom RefreshContainer yourself. And use the custom class to replace the system RefreshContainer.

    Best regards,

    Roy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, March 4, 2019 9:11 AM
    Moderator
  • Update: I've found a similar issue using SwipeControl except sometimes it only freezes the app and no exception is thrown

                <ListView x:Name="lv" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
                    <ListView.ItemTemplate>
                        <DataTemplate>
                            <SwipeControl
                            HorizontalAlignment="Stretch">
                                <TextBlock Text="{Binding}" VerticalAlignment="Center"
                                           HorizontalAlignment="Center"/>
                            </SwipeControl>
                        </DataTemplate>
                    </ListView.ItemTemplate>
                </ListView>
    Is the issue with these controls or with the app registering/detecting touch interactions and gestures?

    Tuesday, March 26, 2019 9:54 AM