Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PopPageModel crash on iOS #307

Open
minaairsupport opened this issue Apr 26, 2020 · 5 comments
Open

PopPageModel crash on iOS #307

minaairsupport opened this issue Apr 26, 2020 · 5 comments

Comments

@minaairsupport
Copy link

minaairsupport commented Apr 26, 2020

here is the problem sample
I push page in Modal mode
await CoreMethods.PushPageModel<myPage>(mydata, true, true)
the same for pop page
await CoreMethods.PopPageModel(true, true);
but its crash with that error on iOS platform only
IItemsViewSource is empty

could you fix that bug on iOS 13.4.1

the whole error for more details

2020-04-26 23:42:31.139717+0200 Pyx.Mobile.iOS[9154:491512] [AppCenterCrashes] ERROR: +[MSWrapperLogger MSWrapperLog:tag:level:]/10 Unhandled Exception:
System.IndexOutOfRangeException: IItemsViewSource is empty
  at Xamarin.Forms.Platform.iOS.EmptySource.GetIndexForItem (System.Object item) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\CollectionView\EmptySource.cs:26 
  at Xamarin.Forms.Platform.iOS.ItemsViewController`1[TItemsView].GetIndexForItem (System.Object item) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\CollectionView\ItemsViewController.cs:231 
  at Xamarin.Forms.Platform.iOS.CarouselViewController.UpdateFromPosition () [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\CollectionView\CarouselViewController.cs:220 
  at Xamarin.Forms.Platform.iOS.CarouselViewController.CarouselViewPropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs changedProperty) [0x0000d] in D:\a\1\s\Xamarin.Forms.Platform.iOS\CollectionView\CarouselViewController.cs:172 
  at (wrapper delegate-invoke) <Module>.invoke_void_object_PropertyChangedEventArgs(object,System.ComponentModel.PropertyChangedEventArgs)
  at Xamarin.Forms.BindableObject.OnPropertyChanged (System.String propertyName) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:229 
  at Xamarin.Forms.Element.OnPropertyChanged (System.String propertyName) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:353 
  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) [0x00114] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:461 
  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) [0x00214] in D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:155 
  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:72 
  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:504 
  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.VisualElement.OnBindingContextChanged () [0x00006] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:745 
  at Xamarin.Forms.View.OnBindingContextChanged () [0x0000c] in D:\a\1\s\Xamarin.Forms.Core\View.cs:158 
  at Xamarin.Forms.BindableObject.SetInheritedBindingContext (Xamarin.Forms.BindableObject bindable, System.Object value) [0x00062] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:210 
  at Xamarin.Forms.Element.SetChildInheritedBindingContext (Xamarin.Forms.Element child, System.Object context) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:504 
  at Xamarin.Forms.TemplatedView.SetChildInheritedBindingContext (Xamarin.Forms.Element child, System.Object context) [0x00008] in D:\a\1\s\Xamarin.Forms.Core\TemplatedView.cs:69 
  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.VisualElement.OnBindingContextChanged () [0x00006] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:745 
  at Xamarin.Forms.View.OnBindingContextChanged () [0x0000c] in D:\a\1\s\Xamarin.Forms.Core\View.cs:158 
  at Xamarin.Forms.ContentView.OnBindingContextChanged () [0x00000] in D:\a\1\s\Xamarin.Forms.Core\ContentView.cs:16 
  at Xamarin.Forms.BindableObject.SetInheritedBindingContext (Xamarin.Forms.BindableObject bindable, System.Object value) [0x00062] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:210 
  at Xamarin.Forms.Element.SetChildInheritedBindingContext (Xamarin.Forms.Element child, System.Object context) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:504 
  at Xamarin.Forms.TemplatedPage.SetChildInheritedBindingContext (Xamarin.Forms.Element child, System.Object context) [0x00008] in D:\a\1\s\Xamarin.Forms.Core\TemplatedPage.cs:38 
  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.VisualElement.OnBindingContextChanged () [0x00006] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:745 
  at Xamarin.Forms.Page.OnBindingContextChanged () [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Page.cs:303 
  at Xamarin.Forms.ContentPage.OnBindingContextChanged () [0x00000] in D:\a\1\s\Xamarin.Forms.Core\ContentPage.cs:16 
  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 FreshMvvm.FreshBasePageModel.RaisePageWasPopped () [0x00095] in C:\Projects\FreshMvvm\src\FreshMvvm\FreshBasePageModel.cs:153 
  at FreshMvvm.PageModelCoreMethods.PopPageModel (System.Boolean modal, System.Boolean animate) [0x0009f] in C:\Projects\FreshMvvm\src\FreshMvvm\PageModelCoreMethods.cs:106 
  at Pyx.Mobile.PageModels.Screenings.CardOverlayContainerPageModel.ExitPage () [0x00053] in /Users/minafawzy/Documents/Pyx.Mobile/Pyx.Mobile/Pyx.Mobile/PageModels/Screenings/CardOverlayContainerPageModel.cs:471 
  at Pyx.Mobile.PageModels.Screenings.CardOverlayContainerPageModel.<get_NextScreen>b__35_0 () [0x00095] in /Users/minafawzy/Documents/Pyx.Mobile/Pyx.Mobile/Pyx.Mobile/PageModels/Screenings/CardOverlayContainerPageModel.cs:311 
  at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_0 (System.Object state) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:1021 
  at Foundation.NSAsyncSynchronizationContextDispatcher.Apply () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.16.0.13/src/Xamarin.iOS/Foundation/NSAction.cs:178 
--- End of stack trace from previous location where exception was thrown ---

@candidodmv
Copy link

candidodmv commented Oct 23, 2020

I had the same problem. Due the urgency to solve the problem, the solution was drop it from the project.

@mwerickson
Copy link

I'm now running into a similar problem, however this is with a CollectionView on the page. The page is a TabbedPage, navigated to using a new navigation service. Upon closing the page the following is called:

await CoreMethods.PopModalNavigationService();

XF: 4.8.0.1269
FreshMvvm: 3.0.0
XCode: 12.0.1
VS 2109: 16.7.5

EmptySource.GetIndexForItem (System.Object item) D:\a\1\s\Xamarin.Forms.Platform.iOS\CollectionView\EmptySource.cs:26
ItemsViewController`1[TItemsView].GetIndexForItem (System.Object item) D:\a\1\s\Xamarin.Forms.Platform.iOS\CollectionView\ItemsViewController.cs:208
SelectableItemsViewController`1[TItemsView].SelectItem (System.Object selectedItem) D:\a\1\s\Xamarin.Forms.Platform.iOS\CollectionView\SelectableItemsViewController.cs:36
SelectableItemsViewController`1[TItemsView].UpdateNativeSelection () D:\a\1\s\Xamarin.Forms.Platform.iOS\CollectionView\SelectableItemsViewController.cs:106
SelectableItemsViewRenderer`2[TItemsView,TViewController].UpdateNativeSelection () D:\a\1\s\Xamarin.Forms.Platform.iOS\CollectionView\SelectableItemsViewRenderer.cs:47
SelectableItemsViewRenderer`2[TItemsView,TViewController].UpdateItemsSource () D:\a\1\s\Xamarin.Forms.Platform.iOS\CollectionView\SelectableItemsViewRenderer.cs:58
ItemsViewRenderer`2[TItemsView,TViewController].OnElementPropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs changedProperty) D:\a\1\s\Xamarin.Forms.Platform.iOS\CollectionView\ItemsViewRenderer.cs:47
StructuredItemsViewRenderer`2[TItemsView,TViewController].OnElementPropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs changedProperty) D:\a\1\s\Xamarin.Forms.Platform.iOS\CollectionView\StructuredItemsViewRenderer.cs:19
SelectableItemsViewRenderer`2[TItemsView,TViewController].OnElementPropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs changedProperty) D:\a\1\s\Xamarin.Forms.Platform.iOS\CollectionView\SelectableItemsViewRenderer.cs:20
GroupableItemsViewRenderer`2[TItemsView,TViewController].OnElementPropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs changedProperty) D:\a\1\s\Xamarin.Forms.Platform.iOS\CollectionView\GroupableItemsViewRenderer.cs:19
(wrapper delegate-invoke) <Module>.invoke_void_object_PropertyChangedEventArgs(object,System.ComponentModel.PropertyChangedEventArgs)
BindableObject.OnPropertyChanged (System.String propertyName) D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:229
Element.OnPropertyChanged (System.String propertyName) D:\a\1\s\Xamarin.Forms.Core\Element.cs:353
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) D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:461
BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:397
BindingExpression.ApplyCore (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property, System.Boolean fromTarget) D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:155
BindingExpression.Apply (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property) D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:72
Binding.Apply (System.Object context, Xamarin.Forms.BindableObject bindObj, Xamarin.Forms.BindableProperty targetProperty, System.Boolean fromBindingContextChanged) D:\a\1\s\Xamarin.Forms.Core\Binding.cs:138
BindableObject.ApplyBindings (System.Boolean skipBindingContext, System.Boolean fromBindingContextChanged) D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:480
BindableObject.SetInheritedBindingContext (Xamarin.Forms.BindableObject bindable, System.Object value) D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:209
Element.SetChildInheritedBindingContext (Xamarin.Forms.Element child, System.Object context) D:\a\1\s\Xamarin.Forms.Core\Element.cs:470
Element.<OnBindingContextChanged>b__82_0 (Xamarin.Forms.BindableObject child, System.Object bc) D:\a\1\s\Xamarin.Forms.Core\Element.cs:308
BindableObjectExtensions.PropagateBindingContext[T] (Xamarin.Forms.BindableObject self, System.Collections.Generic.IList`1[T] children, System.Action`2[T1,T2] setChildBindingContext) D:\a\1\s\Xamarin.Forms.Core\BindableObjectExtensions.cs:28
Element.OnBindingContextChanged () D:\a\1\s\Xamarin.Forms.Core\Element.cs:306
VisualElement.OnBindingContextChanged () D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:812
View.OnBindingContextChanged () D:\a\1\s\Xamarin.Forms.Core\View.cs:158
BindableObject.SetInheritedBindingContext (Xamarin.Forms.BindableObject bindable, System.Object value) D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:210
Element.SetChildInheritedBindingContext (Xamarin.Forms.Element child, System.Object context) D:\a\1\s\Xamarin.Forms.Core\Element.cs:470
TemplatedPage.SetChildInheritedBindingContext (Xamarin.Forms.Element child, System.Object context) D:\a\1\s\Xamarin.Forms.Core\TemplatedPage.cs:38
Element.<OnBindingContextChanged>b__82_0 (Xamarin.Forms.BindableObject child, System.Object bc) D:\a\1\s\Xamarin.Forms.Core\Element.cs:308
BindableObjectExtensions.PropagateBindingContext[T] (Xamarin.Forms.BindableObject self, System.Collections.Generic.IList`1[T] children, System.Action`2[T1,T2] setChildBindingContext) D:\a\1\s\Xamarin.Forms.Core\BindableObjectExtensions.cs:28
Element.OnBindingContextChanged () D:\a\1\s\Xamarin.Forms.Core\Element.cs:306
VisualElement.OnBindingContextChanged () D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:812
Page.OnBindingContextChanged () D:\a\1\s\Xamarin.Forms.Core\Page.cs:306
ContentPage.OnBindingContextChanged () D:\a\1\s\Xamarin.Forms.Core\ContentPage.cs:16
BindableObject.BindingContextPropertyChanged (Xamarin.Forms.BindableObject bindable, System.Object oldvalue, System.Object newvalue) D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:500
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) D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:463
BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:397
BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value, System.Boolean fromStyle, System.Boolean checkAccess) D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:334
BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value) D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:311
BindableObject.set_BindingContext (System.Object value) D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:41
FreshBasePageModel.RaisePageWasPopped () C:\Projects\FreshMvvm\src\FreshMvvm\FreshBasePageModel.cs:153
PageExtensions.NotifyAllChildrenPopped (Xamarin.Forms.NavigationPage navigationPage) C:\Projects\FreshMvvm\src\FreshMvvm\PageExtensions.cs:27
FreshIconTabbedNavigationContainer.NotifyChildrenPageWasPopped () C:\Users\Justin\source\repos\irmobile\IRMobile\IRMobile\Navigation\FreshIconTabbedNavigationContainer.cs:106
PageModelCoreMethods.PopModalNavigationService (System.Boolean animate) C:\Projects\FreshMvvm\src\FreshMvvm\PageModelCoreMethods.cs:195
Yard2ReceiveTabPageModel.<get_CloseCommand>b__21_0 () C:\Users\Justin\source\repos\irmobile\IRMobile\IRMobile\PageModels\Yard2ReceiveTabPageModel.cs:123
AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_0 (System.Object state) /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:1021
NSAsyncSynchronizationContextDispatcher.Apply () /Library/Frameworks/Xamarin.iOS.framework/Versions/14.0.0.0/src/Xamarin.iOS/Foundation/NSAction.cs:178
(wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) /Library/Frameworks/Xamarin.iOS.framework/Versions/14.0.0.0/src/Xamarin.iOS/UIKit/UIApplication.cs:86
UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) /Library/Frameworks/Xamarin.iOS.framework/Versions/14.0.0.0/src/Xamarin.iOS/UIKit/UIApplication.cs:65
Application.Main (System.String[] args) C:\Users\Justin\source\repos\irmobile\IRMobile\IRMobile.iOS\Main.cs:19

@Hackavist
Copy link

I having the Same issue with collection View on XF 5

@salgiza
Copy link

salgiza commented Jul 19, 2021

I'll add myself to the list of people affected by this bug. I am showing a very simple CollectionView, with an ItemsSource and a SelectedItem, and there is something going on when the bindings are removed in iOS (having a selected item).

The weird thing: if I pop the page to go back to the previous page in the modal navigation service:

await CoreMethods.PopPageModel();

It works perfectly. But if I close the modal navigation using:

await CoreMethods.PopModalNavigationService();

The page crashes (only in iOS), with a "IItemsViewSource is empty" error message.

Using FreshMvvM 4.0.1 and Xamarin.Forms 5.0.0.2083

@salgiza
Copy link

salgiza commented Jul 19, 2021

For what is worth, I've ended up doing this as a workaround, until this bug is fixed (either in FreshMvvm or XF, because I don't really know which one is causing it):

 if (Device.RuntimePlatform == Device.iOS) { await CoreMethods.PopToRoot(false); }
 await CoreMethods.PopModalNavigationService();

Not ideal (to say the least), but PopToRoot, just as PopPageModel, works without crashing, and the modal navigation disappears fast enough in iOS that the first page in the modal navigation is barely visible (and kind of makes sense in my particular case).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants