Cardview: [UWP] Window resizing crash

Created on 28 Aug 2018  路  5Comments  路  Source: AndreiMisiukevich/CardView

Steps to reproduce:

Version 1.6.1

1) Resize the window (a few times)

<cvcontrols:ParentScrollView>
                <StackLayout CompressedLayout.IsHeadless="true" Spacing="0">
                    <cvcards:CarouselView ItemsSource="{Binding ImageUrls}"
                                          HorizontalOptions="FillAndExpand"
                                          HeightRequest="313">
                        <cvcards:CarouselView.ItemTemplate>
                            <DataTemplate>
                                <ContentView>
                                    <ffimageloading:CachedImage Source="{Binding ., Converter={c:FromImageUrlConverter}}"
                                                                LoadingPlaceholder="resource://loading.png"
                                                                ErrorPlaceholder="resource://error.png"
                                                                Aspect="AspectFill"
                                                                VerticalOptions="FillAndExpand"
                                                                HorizontalOptions="FillAndExpand"
                                                                WidthRequest="500"
                                                                HeightRequest="313"
                                                                DownsampleToViewSize="true">
                                    </ffimageloading:CachedImage>
                                </ContentView>
                            </DataTemplate>
                        </cvcards:CarouselView.ItemTemplate>
                        <cvcontrols:IndicatorsControl/>
                    </cvcards:CarouselView>
</cvcontrols:ParentScrollView>
</StackLayout>

2) Get the crash

Cannot change ObservableCollection during a CollectionChanged event.

   at Xamarin.Forms.Platform.UWP.TaskExtensions.<>c.<WatchForError>b__2_1(Object e)
   at System.Threading.WinRTSynchronizationContextBase.Invoker.InvokeCore()
bug resolved uwp

All 5 comments

@JTOne123 Hi. Unfortunately, I have no windows PC/Laptop..
Could you try to investigate this issue?

yes, sure

Fixed https://github.com/AndreiMisiukevich/CardView/pull/99

There are two exceptions here
1 In the adding
2 In the removing

   at System.Collections.ObjectModel.ObservableCollection`1.CheckReentrancy()
   at System.Collections.ObjectModel.ObservableCollection`1.InsertItem(Int32 index, T item)
   at System.Collections.ObjectModel.Collection`1.Insert(Int32 index, T item)
   at Xamarin.Forms.ObservableWrapper`2.Insert(Int32 index, TRestrict item)
   at PanCardView.CardsView.AddChild(View topView, View[] views)
   at PanCardView.CardsView.GetViews(AnimationDirection animationDirection, ICardProcessor processor, Int32[] indeces)
   at PanCardView.CardsView.SetupNextView()
   at PanCardView.CardsView.SetupBackViews()
   at PanCardView.CardsView.<SetCurrentView>d__202.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.<ThrowAsync>b__6_0(Object state)
   at System.Threading.WinRTSynchronizationContextBase.Invoker.InvokeCore()

Steps to reproduce
1 In the sample, in CarouselSampleXamlView.xaml need to set SlideShowDuration="100"
2 After that fast resize the app's window a few times

Wow, great
I will validate the PR on this week

@JTOne123 thanks
Will be available in next release (I'll create it tomorrow, i think, or on weekend)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

2092015 picture 2092015  路  5Comments

SkeletonJohn picture SkeletonJohn  路  3Comments

toshitani23 picture toshitani23  路  6Comments

troyvnit picture troyvnit  路  8Comments

TSerra-PT picture TSerra-PT  路  6Comments