Cardview: CarouselView gets out of sync with rapid swiping of views

Created on 10 Dec 2019  Â·  37Comments  Â·  Source: AndreiMisiukevich/CardView

I have a page with a CarouselView containing 4 view - on rapid swiping data gets out of sync.
The data that should be shown on 4th view is show on 3rd view and when you swipe to 4th view its blank.
I have tried setting IsViewReusingEnabled = false but still getting out of sync data.

Also in between swiping - i get the following message in the console.

_CardsView: Couldn't handle InvalidOperationException_

Below is the code snippet:

<cards:CarouselView
                Grid.Row="1"
                x:Name="MainCardView"
                IsCyclical="False"
                IsClippedToBounds="True"
                IsViewReusingEnabled = "False"
                SelectedIndex="{Binding SelectedIndex, Mode=TwoWay}"
                BackgroundColor="White"
                ItemsSource="{Binding Characteristics}">
                <cards:CarouselView.ItemTemplate>
                    <DataTemplate>
                        <ScrollView
                            BackgroundColor="{StaticResource AppWhite}"
                            Padding="24,0,24,16">
                            <StackLayout
                                Spacing="16"
                                BindableLayout.ItemsSource="{Binding Sections}"
                                BindableLayout.ItemTemplateSelector="{StaticResource ExploreDataTemplateSelector}">
                            </StackLayout>
                        </ScrollView>
                    </DataTemplate>
                </cards:CarouselView.ItemTemplate>
                <cardsControl:IndicatorsControl
                    SelectedIndicatorStyle="{StaticResource ActiveIndicator}"
                    UnselectedIndicatorStyle="{StaticResource InactiveIndicator}" />
            </cards:CarouselView>
Xamarin.Forms bug resolved

All 37 comments

Hi @AnthonyNjuguna
Can you fork my repository and create reproduction sample there, then just send me a link to test branch. It will allow me to fix this issue ASAP

Thanks

CardsView: Couldn't handle InvalidOperationException

@AnthonyNjuguna is it iOS, right?

Yes issue only affecting iOS

Yes issue only affecting iOS

Well, try to set DesiredMaxChildrenCount = 12

and provide a sample please

I have updated the sample on my fork - the first button opens a page with the issue - then if you swipe quickly from 1st to 3rd page the content on the 4th page is shown the if you swipe back and forth the animation breaks and you have views overlapping.

I will also have no more that 5 views so wouldn't mind if all views were cached and didn't have to recreate all the time

@AnthonyNjuguna is it possible to reproduce on simulator?

Yes

@AnthonyNjuguna cool, I will try

should I use any specific simulator?

Did you manage to replicate?

@AnthonyNjuguna sorry, I haven't taken a look yet.

anything?

here is what i can reproduce

image

btw did you try on real device or simulator?

I removed TextType="Html" from Label and cannot reproduce this issue anymore.
I added some more checks in code, but seems it's XF issue

Hi Andrei,
I got exactly same issue like this, although i'm using Lable TextType="Text", but it's intermittent issue, happened on both device and simulator, and only on iOS.

Updated more info: it happens only when using pan/swipe to navigate card, if i use a button to trigger navigating card by setting SelectedIndex, it has no issue.

Hi Andrei,
I got exactly same issue like this, although i'm using Lable TextType="Text", but it's intermittent issue, happened on both device and simulator, and only on iOS.

Updated more info: it happens only when using pan/swipe to navigate card, if i use a button to trigger navigating card by setting SelectedIndex, it has no issue.

Do you use ScrollView or ListView ?

Hi Andrei,
I got exactly same issue like this, although i'm using Lable TextType="Text", but it's intermittent issue, happened on both device and simulator, and only on iOS.
Updated more info: it happens only when using pan/swipe to navigate card, if i use a button to trigger navigating card by setting SelectedIndex, it has no issue.

Do you use ScrollView or ListView ?

Hi, order from top to bottom: I have 1 image (using ffimageloading), 1 label, and 1 listview (some screen i use collection view)
Screenshot at Dec 17 11-44-52

Hi Andrei,
I got exactly same issue like this, although i'm using Lable TextType="Text", but it's intermittent issue, happened on both device and simulator, and only on iOS.
Updated more info: it happens only when using pan/swipe to navigate card, if i use a button to trigger navigating card by setting SelectedIndex, it has no issue.

Do you use ScrollView or ListView ?

Hi, order from top to bottom: I have 1 image (using ffimageloading), 1 label, and 1 listview (some screen i use collection view)
Screenshot at Dec 17 11-44-52

I will release new version today. Will you be able to re-validate it then?

Hi, I updated to latest version 2.3.8 and validated. In some screens my Label set TextType="Text", i don't get this issue anymore but in another screen that my Label set TextType="Html" still get this issue.

One more thing, when i press Back button in Navigation header, it will back to previous card before navigating page, is it normal behaviour?

Hi, I updated to latest version 2.3.8 and validated. In some screens my Label set TextType="Text", i don't get this issue anymore but in another screen that my Label set TextType="Html" still get this issue.

One more thing, when i press Back button in Navigation header, it will back to previous card before navigating page, is it normal behaviour?

can you show a video?

Hi, I updated to latest version 2.3.8 and validated. In some screens my Label set TextType="Text", i don't get this issue anymore but in another screen that my Label set TextType="Html" still get this issue.
One more thing, when i press Back button in Navigation header, it will back to previous card before navigating page, is it normal behaviour?

can you show a video?

Check it out here : (removed)
Video include both 2 things i said above. (issue when set TextType="Html" and back to previous card before navigating back page)

@vunhutien thanks

so, i think

1) TextType="Html" : it's something wrong with this label type. But it isn't related to this project, because it works fine with regular labels. No idea for now, what can be wrong
2) back button: it looks like UI glitch. Probably it is related to HTML label as well

@vunhutien thanks

so, i think

  1. TextType="Html" : it's something wrong with this label type. But it isn't related to this project, because it works fine with regular labels. No idea for now, what can be wrong
  2. back button: it looks like UI glitch. Probably it is related to HTML label as well

I agreed that issue no 1 may not related to this library, but i'm not very sure about No 2 cause in screen that i used Text Label it still got that issue.

BTW i highly appreciate your effort to create this lib, troubleshoot issue and resolve it. Thanks so much.

I agreed that issue no 1 may not related to this library, but i'm not very sure about No 2 cause in screen that i used Text Label it still got that issue.

Check 2.3.9 with TEXT label please (not html)

I agreed that issue no 1 may not related to this library, but i'm not very sure about No 2 cause in screen that i used Text Label it still got that issue.

Check 2.3.9 with TEXT label please (not html)

Issue no 2 still happens when update to 2.3.9. I think when navigating back to previous page, back animation makes the cardview think that user swipe or pan from left to right, so it will back to previous card.

I agreed that issue no 1 may not related to this library, but i'm not very sure about No 2 cause in screen that i used Text Label it still got that issue.

Check 2.3.9 with TEXT label please (not html)

Issue no 2 still happens when update to 2.3.9. I think when navigating back to previous page, back animation makes the cardview think that user swipe or pan from left to right, so it will back to previous card.

I don't think so.
I guess It's UI glitch.
You can easily verify it if observe ItemAppearing event or just observe SelectedIndex property changing.

Hopefully you have time to re-open this issue, because when i try to use XF CarouselView and LabelType="Html", it works perfectly, but switch back to your libs, issue happens again, i like to use your control than default XF CarouselView but this issue make me down.

Screenshot at Dec 17 11-44-52

@vunhutien, unfortunately, I cannot resolve this issue on my side, because I do not see any problem on my side.
Probably it's something related to AbsoluteLayout ... cuz my carousel is based on it.

@AndreiMisiukevich This is now causing the app to crash - I have included the stack trace maybe this could be of some help.

System.NullReferenceException: Object reference not set to an instance of an object
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded (Xamarin.Forms.VisualElement view) [0x0004c] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:102 
  at Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded (System.Object sender, Xamarin.Forms.ElementEventArgs e) [0x0000f] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:154 
  at Xamarin.Forms.Element.OnChildAdded (Xamarin.Forms.Element child) [0x0000f] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:326 
  at Xamarin.Forms.VisualElement.OnChildAdded (Xamarin.Forms.Element child) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:742 
  at Xamarin.Forms.Layout`1[T].OnChildAdded (Xamarin.Forms.Element child) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:32 
  at Xamarin.Forms.Layout.OnInternalAdded (Xamarin.Forms.View view) [0x0001d] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:462 
  at Xamarin.Forms.Layout.InternalChildrenOnCollectionChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00078] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:452 
  at (wrapper delegate-invoke) <Module>.invoke_void_object_NotifyCollectionChangedEventArgs(object,System.Collections.Specialized.NotifyCollectionChangedEventArgs)
  at System.Collections.ObjectModel.ObservableCollection`1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00018] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/external/corefx/src/System.ObjectModel/src/System/Collections/ObjectModel/ObservableCollection.cs:263 
  at System.Collections.ObjectModel.ObservableCollection`1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedAction action, System.Object item, System.Int32 index) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/external/corefx/src/System.ObjectModel/src/System/Collections/ObjectModel/ObservableCollection.cs:338 
  at System.Collections.ObjectModel.ObservableCollection`1[T].InsertItem (System.Int32 index, T item) [0x0001a] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/external/corefx/src/System.ObjectModel/src/System/Collections/ObjectModel/ObservableCollection.cs:196 
  at System.Collections.ObjectModel.Collection`1[T].Add (T item) [0x00020] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/external/corefx/src/Common/src/CoreLib/System/Collections/ObjectModel/Collection.cs:71 
  at Xamarin.Forms.ObservableWrapper`2[TTrack,TRestrict].Add (TRestrict item) [0x0004b] in D:\a\1\s\Xamarin.Forms.Core\ObservableWrapper.cs:35 
  at Xamarin.Forms.BindableLayoutController.CreateChildren () [0x00039] in D:\a\1\s\Xamarin.Forms.Core\BindableLayout.cs:178 
  at Xamarin.Forms.BindableLayoutController.SetItemsSource (System.Collections.IEnumerable itemsSource) [0x00051] in D:\a\1\s\Xamarin.Forms.Core\BindableLayout.cs:132 
  at Xamarin.Forms.BindableLayoutController.set_ItemsSource (System.Collections.IEnumerable value) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableLayout.cs:95 
  at Xamarin.Forms.BindableLayout+<>c.<.cctor>b__13_0 (Xamarin.Forms.BindableObject b, System.Object o, System.Object n) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableLayout.cs:12 
  at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attributes, System.Boolean silent) [0x00120] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:463 
  at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x00173] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:397 
  at Xamarin.Forms.BindingExpression.ApplyCore (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property, System.Boolean fromTarget) [0x00220] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:156 
  at Xamarin.Forms.BindingExpression.Apply (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property) [0x0006b] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:71 
  at Xamarin.Forms.Binding.Apply (System.Object context, Xamarin.Forms.BindableObject bindObj, Xamarin.Forms.BindableProperty targetProperty, System.Boolean fromBindingContextChanged) [0x0006d] in D:\a\1\s\Xamarin.Forms.Core\Binding.cs:136 
  at Xamarin.Forms.BindableObject.ApplyBindings (System.Boolean skipBindingContext, System.Boolean fromBindingContextChanged) [0x00041] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:480 
  at Xamarin.Forms.BindableObject.SetInheritedBindingContext (Xamarin.Forms.BindableObject bindable, System.Object value) [0x0005a] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:209 
  at Xamarin.Forms.Element.SetChildInheritedBindingContext (Xamarin.Forms.Element child, System.Object context) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:505 
  at Xamarin.Forms.Element.<OnBindingContextChanged>b__82_0 (Xamarin.Forms.BindableObject child, System.Object bc) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:308 
  at Xamarin.Forms.BindableObjectExtensions.PropagateBindingContext[T] (Xamarin.Forms.BindableObject self, System.Collections.Generic.IList`1[T] children, System.Action`2[T1,T2] setChildBindingContext) [0x0002c] in D:\a\1\s\Xamarin.Forms.Core\BindableObjectExtensions.cs:28 
  at Xamarin.Forms.Element.OnBindingContextChanged () [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:306 
  at Xamarin.Forms.View.OnBindingContextChanged () [0x0000c] in D:\a\1\s\Xamarin.Forms.Core\View.cs:158 
  at Xamarin.Forms.BindableObject.BindingContextPropertyChanged (Xamarin.Forms.BindableObject bindable, System.Object oldvalue, System.Object newvalue) [0x0000f] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:500 
  at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attributes, System.Boolean silent) [0x00120] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:463 
  at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x00173] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:397 
  at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value, System.Boolean fromStyle, System.Boolean checkAccess) [0x00042] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:334 
  at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:311 
  at Xamarin.Forms.BindableObject.set_BindingContext (System.Object value) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:41 
  at PanCardView.CardsView.PrepareView (System.Collections.Generic.IEnumerable`1[T] bookedViews, System.Int32 index) [0x0005e] in <0a9fd40be2374d6f845f9e47fcfa5a8a>:0 
  at PanCardView.CardsView.InitViews (PanCardView.Processors.ICardProcessor processor, PanCardView.Enums.AnimationDirection animationDirection, System.Collections.Generic.IEnumerable`1[T] bookedViews, System.Int32[] indeces) [0x00014] in <0a9fd40be2374d6f845f9e47fcfa5a8a>:0 
  at PanCardView.CardsView.SetupNextView (System.Int32 index, System.Collections.Generic.IEnumerable`1[T] bookedViews) [0x00039] in <0a9fd40be2374d6f845f9e47fcfa5a8a>:0 
  at PanCardView.CardsView.SetupBackViews (System.Nullable`1[T] index) [0x00029] in <0a9fd40be2374d6f845f9e47fcfa5a8a>:0 
  at PanCardView.CardsView.OnTouchStarted () [0x0005f] in <0a9fd40be2374d6f845f9e47fcfa5a8a>:0 
  at PanCardView.CardsView.OnPanUpdated (Xamarin.Forms.PanUpdatedEventArgs e) [0x0004a] in <0a9fd40be2374d6f845f9e47fcfa5a8a>:0 
  at PanCardView.CardsView.OnPanUpdated (System.Object sender, Xamarin.Forms.PanUpdatedEventArgs e) [0x00000] in <0a9fd40be2374d6f845f9e47fcfa5a8a>:0 
  at Xamarin.Forms.PanGestureRecognizer.SendPanStarted (Xamarin.Forms.Element sender, System.Int32 gestureId) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\PanGestureRecognizer.cs:38 

I see that the crash occurred in XF code

On Tue, Jan 28, 2020 at 18:44 AnthonyNjuguna notifications@github.com
wrote:

This is now causing the app to crash - I have included the stack trace
maybe this could be of some help.

System.NullReferenceException: Object reference not set to an instance of an object
at Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded (Xamarin.Forms.VisualElement view) [0x0004c] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:102
at Xamarin.Forms.Platform.iOS.VisualElementPackager.OnChildAdded (System.Object sender, Xamarin.Forms.ElementEventArgs e) [0x0000f] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:154
at Xamarin.Forms.Element.OnChildAdded (Xamarin.Forms.Element child) [0x0000f] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:326
at Xamarin.Forms.VisualElement.OnChildAdded (Xamarin.Forms.Element child) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:742
at Xamarin.Forms.Layout1[T].OnChildAdded (Xamarin.Forms.Element child) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:32 at Xamarin.Forms.Layout.OnInternalAdded (Xamarin.Forms.View view) [0x0001d] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:462 at Xamarin.Forms.Layout.InternalChildrenOnCollectionChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00078] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:452 at (wrapper delegate-invoke) <Module>.invoke_void_object_NotifyCollectionChangedEventArgs(object,System.Collections.Specialized.NotifyCollectionChangedEventArgs) at System.Collections.ObjectModel.ObservableCollection1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00018] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/external/corefx/src/System.ObjectModel/src/System/Collections/ObjectModel/ObservableCollection.cs:263
at System.Collections.ObjectModel.ObservableCollection1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedAction action, System.Object item, System.Int32 index) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/external/corefx/src/System.ObjectModel/src/System/Collections/ObjectModel/ObservableCollection.cs:338 at System.Collections.ObjectModel.ObservableCollection1[T].InsertItem (System.Int32 index, T item) [0x0001a] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/external/corefx/src/System.ObjectModel/src/System/Collections/ObjectModel/ObservableCollection.cs:196
at System.Collections.ObjectModel.Collection1[T].Add (T item) [0x00020] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/external/corefx/src/Common/src/CoreLib/System/Collections/ObjectModel/Collection.cs:71 at Xamarin.Forms.ObservableWrapper2[TTrack,TRestrict].Add (TRestrict item) [0x0004b] in D:\a\1\s\Xamarin.Forms.Core\ObservableWrapper.cs:35
at Xamarin.Forms.BindableLayoutController.CreateChildren () [0x00039] in D:\a\1\s\Xamarin.Forms.Core\BindableLayout.cs:178
at Xamarin.Forms.BindableLayoutController.SetItemsSource (System.Collections.IEnumerable itemsSource) [0x00051] in D:\a\1\s\Xamarin.Forms.Core\BindableLayout.cs:132
at Xamarin.Forms.BindableLayoutController.set_ItemsSource (System.Collections.IEnumerable value) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableLayout.cs:95
at Xamarin.Forms.BindableLayout+<>c.<.cctor>b__13_0 (Xamarin.Forms.BindableObject b, System.Object o, System.Object n) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableLayout.cs:12
at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attributes, System.Boolean silent) [0x00120] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:463
at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x00173] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:397
at Xamarin.Forms.BindingExpression.ApplyCore (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property, System.Boolean fromTarget) [0x00220] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:156
at Xamarin.Forms.BindingExpression.Apply (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property) [0x0006b] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:71
at Xamarin.Forms.Binding.Apply (System.Object context, Xamarin.Forms.BindableObject bindObj, Xamarin.Forms.BindableProperty targetProperty, System.Boolean fromBindingContextChanged) [0x0006d] in D:\a\1\s\Xamarin.Forms.Core\Binding.cs:136
at Xamarin.Forms.BindableObject.ApplyBindings (System.Boolean skipBindingContext, System.Boolean fromBindingContextChanged) [0x00041] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:480
at Xamarin.Forms.BindableObject.SetInheritedBindingContext (Xamarin.Forms.BindableObject bindable, System.Object value) [0x0005a] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:209
at Xamarin.Forms.Element.SetChildInheritedBindingContext (Xamarin.Forms.Element child, System.Object context) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:505
at Xamarin.Forms.Element.b__82_0 (Xamarin.Forms.BindableObject child, System.Object bc) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:308
at Xamarin.Forms.BindableObjectExtensions.PropagateBindingContext[T] (Xamarin.Forms.BindableObject self, System.Collections.Generic.IList1[T] children, System.Action2[T1,T2] setChildBindingContext) [0x0002c] in D:\a\1\s\Xamarin.Forms.Core\BindableObjectExtensions.cs:28
at Xamarin.Forms.Element.OnBindingContextChanged () [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:306
at Xamarin.Forms.View.OnBindingContextChanged () [0x0000c] in D:\a\1\s\Xamarin.Forms.Core\View.cs:158
at Xamarin.Forms.BindableObject.BindingContextPropertyChanged (Xamarin.Forms.BindableObject bindable, System.Object oldvalue, System.Object newvalue) [0x0000f] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:500
at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attributes, System.Boolean silent) [0x00120] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:463
at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x00173] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:397
at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value, System.Boolean fromStyle, System.Boolean checkAccess) [0x00042] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:334
at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:311
at Xamarin.Forms.BindableObject.set_BindingContext (System.Object value) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:41
at PanCardView.CardsView.PrepareView (System.Collections.Generic.IEnumerable1[T] bookedViews, System.Int32 index) [0x0005e] in <0a9fd40be2374d6f845f9e47fcfa5a8a>:0 at PanCardView.CardsView.InitViews (PanCardView.Processors.ICardProcessor processor, PanCardView.Enums.AnimationDirection animationDirection, System.Collections.Generic.IEnumerable1[T] bookedViews, System.Int32[] indeces) [0x00014] in <0a9fd40be2374d6f845f9e47fcfa5a8a>:0
at PanCardView.CardsView.SetupNextView (System.Int32 index, System.Collections.Generic.IEnumerable1[T] bookedViews) [0x00039] in <0a9fd40be2374d6f845f9e47fcfa5a8a>:0 at PanCardView.CardsView.SetupBackViews (System.Nullable1[T] index) [0x00029] in <0a9fd40be2374d6f845f9e47fcfa5a8a>:0
at PanCardView.CardsView.OnTouchStarted () [0x0005f] in <0a9fd40be2374d6f845f9e47fcfa5a8a>:0
at PanCardView.CardsView.OnPanUpdated (Xamarin.Forms.PanUpdatedEventArgs e) [0x0004a] in <0a9fd40be2374d6f845f9e47fcfa5a8a>:0
at PanCardView.CardsView.OnPanUpdated (System.Object sender, Xamarin.Forms.PanUpdatedEventArgs e) [0x00000] in <0a9fd40be2374d6f845f9e47fcfa5a8a>:0
at Xamarin.Forms.PanGestureRecognizer.SendPanStarted (Xamarin.Forms.Element sender, System.Int32 gestureId) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\PanGestureRecognizer.cs:38

—
You are receiving this because you modified the open/close state.

Reply to this email directly, view it on GitHub
https://github.com/AndreiMisiukevich/CardView/issues/316?email_source=notifications&email_token=ACNH4DWPSZFUKL7XC23GF2TRABHEFA5CNFSM4JY4OTQKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEKDZO3Y#issuecomment-579311471,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ACNH4DROVOREAFQ6UTI27PDRABHEFANCNFSM4JY4OTQA
.

>

Andrei Misiukevich

Lead Software Engineer at ISsoft Solutions

*mobile: *+375 29 <+375%2017%20389%200100>303 40 07 Email:
andrei.[email protected] Skype: csi.andreymisyukevich

Minsk, *Belarus *(GMT+3)

@AndreiMisiukevich What would you suggest I do. Thanks

@AnthonyNjuguna can you build a sample that reproduces this issue?
It should be reported to XF project

here is the line where the crash occurs https://github.com/xamarin/Xamarin.Forms/blob/master/Xamarin.Forms.Platform.iOS/VisualElementPackager.cs#L102

@AndreiMisiukevich The same sample I provided earlier is the one that is crashing.
Thanks

@AnthonyNjuguna seems XF crashes because I set BindingContext BEFORE adding a view to layout. But it's weird.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

PauchardThomas picture PauchardThomas  Â·  7Comments

TSerra-PT picture TSerra-PT  Â·  6Comments

2092015 picture 2092015  Â·  5Comments

EldinHb picture EldinHb  Â·  8Comments

morhung picture morhung  Â·  7Comments