Comments (4)
Your exception is
System.InvalidOperationException: MauiContext should have been set on parent.
at Microsoft.Maui.Platform.ElementExtensions.ToPlatform(IElement view)
at Microsoft.Maui.Handlers.LayoutHandler.Remove(IView child)
at Microsoft.Maui.Handlers.LayoutHandler.MapRemove(ILayoutHandler handler, ILayout layout, Object arg)
at Microsoft.Maui.CommandMapper`2.<>c__DisplayClass6_0[[Microsoft.Maui.ILayout, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Microsoft.Maui.ILayoutHandler, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].<Add>b__0(IElementHandler h, IElement v, Object o)
at Microsoft.Maui.CommandMapper.InvokeCore(String key, IElementHandler viewHandler, IElement virtualView, Object args)
at Microsoft.Maui.CommandMapper.Invoke(IElementHandler viewHandler, IElement virtualView, String property, Object args)
at Microsoft.Maui.Handlers.ElementHandler.Invoke(String command, Object args)
at Microsoft.Maui.Controls.Layout.NotifyHandler(String action, Int32 index, IView view)
at Microsoft.Maui.Controls.Layout.OnRemove(Int32 index, IView view)
at Microsoft.Maui.Controls.Layout.RemoveAt(Int32 index)
at Microsoft.Maui.Controls.Layout.Remove(IView child)
at Syncfusion.Maui.ImageEditor.ImageEditLayout.RemoveCropView()
at Syncfusion.Maui.ImageEditor.ImageEditLayout.Syncfusion.Maui.ImageEditor.IToolbarActions.CancelEdit()
at Syncfusion.Maui.ImageEditor.ToolbarLayout.HandleItemTapped(SfToolbarItem tappedItem, SfToolbarItem previousItem)
at Syncfusion.Maui.ImageEditor.ToolbarLayout.OnToolbarItemTapped(Object sender, ToolbarTappedEventArgs e)
at Syncfusion.Maui.Core.Internals.SfToolbar.Syncfusion.Maui.Core.Internals.IToolbar.InvokeTappedEvent(SfToolbarItem toolbarItem, SfToolbarItem previousToolbarItem)
at Syncfusion.Maui.Core.Internals.SfToolbarLayout.Syncfusion.Maui.Core.Internals.ITapGestureListener.OnTap(TapEventArgs e)
at Syncfusion.Maui.Core.Internals.GestureDetector.OnTapped(Point touchPoint, Int32 tapCount)
at Syncfusion.Maui.Core.Internals.GestureDetector.UITapGestureExt.OnTap(GestureDetector gestureDetector)
at Syncfusion.Maui.Core.Internals.GestureDetector.UITapGestureExt.<>c__DisplayClass1_0.<.ctor>b__0()
at UIKit.UIGestureRecognizer.ParameterlessDispatch.Activated() in /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIGestureRecognizer.cs:line 107
--- End of stack trace from previous location ---
at ObjCRuntime.Runtime.ThrowException(IntPtr gchandle) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/ObjCRuntime/Runtime.cs:line 2594
at UIKit.UIApplication.UIApplicationMain(Int32 argc, String[] argv, IntPtr principalClassName, IntPtr delegateClassName) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIApplication.cs:line 60
at UIKit.UIApplication.Main(String[] args, Type principalClass, Type delegateClass) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIApplication.cs:line 94
at MauiMopupsSample.Program.Main(String[] args) in /Users/drasticactions/Developer/Work/ImageEditor-Mopup-Issue/MauiMopupsSample/MauiMopupsSample/MauiMopupsSample/Platforms/iOS/Program.cs:line 13
The important parts are
System.InvalidOperationException: MauiContext should have been set on parent.
and
Syncfusion.Maui.Core.Internals.SfToolbar.Syncfusion.Maui.Core.Internals.IToolbar.InvokeTappedEvent(SfToolbarItem toolbarItem, SfToolbarItem previousToolbarItem)
IMO, this seems like a Syncfusion issue. I would direct this to them first, as I think that's the issue's root. If it is MAUI, they can circle back.
@PureWeen @mattleibow what do you all think?
from maui.
I get the same exception when using Carousel in MAUI, it started in version 8.0.60, I tested it in v8.0.40 and it works fine there.
I even tried it in the latest nightly build, 8.0.70-ci.net8.24139.2 and it happens there as well.
For me it takes place when I move to the 4th page of the carousel, the first 3 pages work fine, as soon as I try to move to the 4th page I get the crash.
2024-06-20 20:59:32.172790+0100 MyProject[4427:14609335] Unhandled managed exception: MauiContext should have been set on parent. (System.InvalidOperationException)
at Microsoft.Maui.Platform.ElementExtensions.ToPlatform(IElement view)
at Microsoft.Maui.Handlers.LayoutHandler.Remove(IView child)
at Microsoft.Maui.Handlers.LayoutHandler.MapRemove(ILayoutHandler handler, ILayout layout, Object arg)
at Microsoft.Maui.CommandMapper`2.<>c__DisplayClass6_0[[Microsoft.Maui.ILayout, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Microsoft.Maui.ILayoutHandler, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].<Add>b__0(IElementHandler h, IElement v, Object o)
at Microsoft.Maui.CommandMapper.InvokeCore(String key, IElementHandler viewHandler, IElement virtualView, Object args)
at Microsoft.Maui.CommandMapper.Invoke(IElementHandler viewHandler, IElement virtualView, String property, Object args)
at Microsoft.Maui.Handlers.ElementHandler.Invoke(String command, Object args)
at Microsoft.Maui.Controls.Layout.NotifyHandler(String action, Int32 index, IView view)
at Microsoft.Maui.Controls.Layout.OnRemove(Int32 index, IView view)
at Microsoft.Maui.Controls.FlexLayout.OnRemove(Int32 index, IView view)
at Microsoft.Maui.Controls.Layout.RemoveAt(Int32 index)
at Microsoft.Maui.Controls.BindableLayout.RemoveAt(IBindableLayout layout, Int32 index)
at Microsoft.Maui.Controls.BindableLayoutController.ClearChildren(IBindableLayout layout)
at Microsoft.Maui.Controls.BindableLayoutController.CreateChildren()
at Microsoft.Maui.Controls.BindableLayoutController.SetItemsSource(IEnumerable itemsSource)
at Microsoft.Maui.Controls.BindableLayoutController.set_ItemsSource(IEnumerable value)
at Microsoft.Maui.Controls.BindableLayout.<>c.<.cctor>b__24_0(BindableObject b, Object o, Object n)
at Microsoft.Maui.Controls.BindableObject.SetValueActual(BindableProperty property, BindablePropertyContext context, Object value, Boolean currentlyApplying, SetValueFlags attributes, SetterSpecificity specificity, Boolean silent)
at Microsoft.Maui.Controls.BindableObject.SetValueCore(BindableProperty property, Object value, SetValueFlags attributes, SetValuePrivateFlags privateAttributes, SetterSpecificity specificity)
at Microsoft.Maui.Controls.BindingExpression.ApplyCore(Object sourceObject, BindableObject target, BindableProperty property, Boolean fromTarget, SetterSpecificity specificity)
at Microsoft.Maui.Controls.BindingExpression.Apply(Object sourceObject, BindableObject target, BindableProperty property, SetterSpecificity specificity)
at Microsoft.Maui.Controls.Binding.Apply(Object context, BindableObject bindObj, BindableProperty targetProperty, Boolean fromBindingContextChanged, SetterSpecificity specificity)
at Microsoft.Maui.Controls.BindableObject.ApplyBindings(Boolean skipBindingContext, Boolean fromBindingContextChanged)
at Microsoft.Maui.Controls.BindableObject.BindingContextPropertyChanged(BindableObject bindable, Object oldvalue, Object newvalue)
at Microsoft.Maui.Controls.BindableObject.SetValueActual(BindableProperty property, BindablePropertyContext context, Object value, Boolean currentlyApplying, SetValueFlags attributes, SetterSpecificity specificity, Boolean silent)
at Microsoft.Maui.Controls.BindableObject.SetValueCore(BindableProperty property, Object value, SetValueFlags attributes, SetValuePrivateFlags privateAttributes, SetterSpecificity specificity)
at Microsoft.Maui.Controls.BindableObject.SetValue(BindableProperty property, Object value)
at Microsoft.Maui.Controls.BindableObject.set_BindingContext(Object value)
at Microsoft.Maui.Controls.Handlers.Items.TemplatedCell.Unbind()
at Microsoft.Maui.Controls.Handlers.Items.TemplatedCell.PrepareForReuse()
at UIKit.UICollectionView.DequeueReusableCell(NSString reuseIdentifier, NSIndexPath indexPath) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/build/dotnet/ios/generated-sources/UIKit/UICollectionView.g.cs:line 234
at UIKit.UICollectionView.DequeueReusableCell(String reuseIdentifier, NSIndexPath indexPath) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UICollectionView.cs:line 23
at Microsoft.Maui.Controls.Handlers.Items.ItemsViewController`1[[Microsoft.Maui.Controls.CarouselView, Microsoft.Maui.Controls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].GetCell(UICollectionView collectionView, NSIndexPath indexPath)
at Microsoft.Maui.Controls.Handlers.Items.CarouselViewController.GetCell(UICollectionView collectionView, NSIndexPath indexPath)
at UIKit.UIApplication.UIApplicationMain(Int32 argc, String[] argv, IntPtr principalClassName, IntPtr delegateClassName) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIApplication.cs:line 58
at UIKit.UIApplication.Main(String[] args, Type principalClass, Type delegateClass) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIApplication.cs:line 94
from maui.
I can repro this issue on Visual Studio 17.11.0 Preview 2.1 ( 8.0.40)
from maui.
Your exception is
System.InvalidOperationException: MauiContext should have been set on parent. at Microsoft.Maui.Platform.ElementExtensions.ToPlatform(IElement view) at Microsoft.Maui.Handlers.LayoutHandler.Remove(IView child) at Microsoft.Maui.Handlers.LayoutHandler.MapRemove(ILayoutHandler handler, ILayout layout, Object arg) at Microsoft.Maui.CommandMapper`2.<>c__DisplayClass6_0[[Microsoft.Maui.ILayout, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Microsoft.Maui.ILayoutHandler, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].<Add>b__0(IElementHandler h, IElement v, Object o) at Microsoft.Maui.CommandMapper.InvokeCore(String key, IElementHandler viewHandler, IElement virtualView, Object args) at Microsoft.Maui.CommandMapper.Invoke(IElementHandler viewHandler, IElement virtualView, String property, Object args) at Microsoft.Maui.Handlers.ElementHandler.Invoke(String command, Object args) at Microsoft.Maui.Controls.Layout.NotifyHandler(String action, Int32 index, IView view) at Microsoft.Maui.Controls.Layout.OnRemove(Int32 index, IView view) at Microsoft.Maui.Controls.Layout.RemoveAt(Int32 index) at Microsoft.Maui.Controls.Layout.Remove(IView child) at Syncfusion.Maui.ImageEditor.ImageEditLayout.RemoveCropView() at Syncfusion.Maui.ImageEditor.ImageEditLayout.Syncfusion.Maui.ImageEditor.IToolbarActions.CancelEdit() at Syncfusion.Maui.ImageEditor.ToolbarLayout.HandleItemTapped(SfToolbarItem tappedItem, SfToolbarItem previousItem) at Syncfusion.Maui.ImageEditor.ToolbarLayout.OnToolbarItemTapped(Object sender, ToolbarTappedEventArgs e) at Syncfusion.Maui.Core.Internals.SfToolbar.Syncfusion.Maui.Core.Internals.IToolbar.InvokeTappedEvent(SfToolbarItem toolbarItem, SfToolbarItem previousToolbarItem) at Syncfusion.Maui.Core.Internals.SfToolbarLayout.Syncfusion.Maui.Core.Internals.ITapGestureListener.OnTap(TapEventArgs e) at Syncfusion.Maui.Core.Internals.GestureDetector.OnTapped(Point touchPoint, Int32 tapCount) at Syncfusion.Maui.Core.Internals.GestureDetector.UITapGestureExt.OnTap(GestureDetector gestureDetector) at Syncfusion.Maui.Core.Internals.GestureDetector.UITapGestureExt.<>c__DisplayClass1_0.<.ctor>b__0() at UIKit.UIGestureRecognizer.ParameterlessDispatch.Activated() in /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIGestureRecognizer.cs:line 107 --- End of stack trace from previous location --- at ObjCRuntime.Runtime.ThrowException(IntPtr gchandle) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/ObjCRuntime/Runtime.cs:line 2594 at UIKit.UIApplication.UIApplicationMain(Int32 argc, String[] argv, IntPtr principalClassName, IntPtr delegateClassName) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIApplication.cs:line 60 at UIKit.UIApplication.Main(String[] args, Type principalClass, Type delegateClass) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIApplication.cs:line 94 at MauiMopupsSample.Program.Main(String[] args) in /Users/drasticactions/Developer/Work/ImageEditor-Mopup-Issue/MauiMopupsSample/MauiMopupsSample/MauiMopupsSample/Platforms/iOS/Program.cs:line 13
The important parts are
System.InvalidOperationException: MauiContext should have been set on parent.
and
Syncfusion.Maui.Core.Internals.SfToolbar.Syncfusion.Maui.Core.Internals.IToolbar.InvokeTappedEvent(SfToolbarItem toolbarItem, SfToolbarItem previousToolbarItem)
IMO, this seems like a Syncfusion issue. I would direct this to them first, as I think that's the issue's root. If it is MAUI, they can circle back.
@PureWeen @mattleibow what do you all think?
Your exception is
System.InvalidOperationException: MauiContext should have been set on parent. at Microsoft.Maui.Platform.ElementExtensions.ToPlatform(IElement view) at Microsoft.Maui.Handlers.LayoutHandler.Remove(IView child) at Microsoft.Maui.Handlers.LayoutHandler.MapRemove(ILayoutHandler handler, ILayout layout, Object arg) at Microsoft.Maui.CommandMapper`2.<>c__DisplayClass6_0[[Microsoft.Maui.ILayout, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Microsoft.Maui.ILayoutHandler, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].<Add>b__0(IElementHandler h, IElement v, Object o) at Microsoft.Maui.CommandMapper.InvokeCore(String key, IElementHandler viewHandler, IElement virtualView, Object args) at Microsoft.Maui.CommandMapper.Invoke(IElementHandler viewHandler, IElement virtualView, String property, Object args) at Microsoft.Maui.Handlers.ElementHandler.Invoke(String command, Object args) at Microsoft.Maui.Controls.Layout.NotifyHandler(String action, Int32 index, IView view) at Microsoft.Maui.Controls.Layout.OnRemove(Int32 index, IView view) at Microsoft.Maui.Controls.Layout.RemoveAt(Int32 index) at Microsoft.Maui.Controls.Layout.Remove(IView child) at Syncfusion.Maui.ImageEditor.ImageEditLayout.RemoveCropView() at Syncfusion.Maui.ImageEditor.ImageEditLayout.Syncfusion.Maui.ImageEditor.IToolbarActions.CancelEdit() at Syncfusion.Maui.ImageEditor.ToolbarLayout.HandleItemTapped(SfToolbarItem tappedItem, SfToolbarItem previousItem) at Syncfusion.Maui.ImageEditor.ToolbarLayout.OnToolbarItemTapped(Object sender, ToolbarTappedEventArgs e) at Syncfusion.Maui.Core.Internals.SfToolbar.Syncfusion.Maui.Core.Internals.IToolbar.InvokeTappedEvent(SfToolbarItem toolbarItem, SfToolbarItem previousToolbarItem) at Syncfusion.Maui.Core.Internals.SfToolbarLayout.Syncfusion.Maui.Core.Internals.ITapGestureListener.OnTap(TapEventArgs e) at Syncfusion.Maui.Core.Internals.GestureDetector.OnTapped(Point touchPoint, Int32 tapCount) at Syncfusion.Maui.Core.Internals.GestureDetector.UITapGestureExt.OnTap(GestureDetector gestureDetector) at Syncfusion.Maui.Core.Internals.GestureDetector.UITapGestureExt.<>c__DisplayClass1_0.<.ctor>b__0() at UIKit.UIGestureRecognizer.ParameterlessDispatch.Activated() in /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIGestureRecognizer.cs:line 107 --- End of stack trace from previous location --- at ObjCRuntime.Runtime.ThrowException(IntPtr gchandle) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/ObjCRuntime/Runtime.cs:line 2594 at UIKit.UIApplication.UIApplicationMain(Int32 argc, String[] argv, IntPtr principalClassName, IntPtr delegateClassName) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIApplication.cs:line 60 at UIKit.UIApplication.Main(String[] args, Type principalClass, Type delegateClass) in /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIApplication.cs:line 94 at MauiMopupsSample.Program.Main(String[] args) in /Users/drasticactions/Developer/Work/ImageEditor-Mopup-Issue/MauiMopupsSample/MauiMopupsSample/MauiMopupsSample/Platforms/iOS/Program.cs:line 13
The important parts are
System.InvalidOperationException: MauiContext should have been set on parent.
and
Syncfusion.Maui.Core.Internals.SfToolbar.Syncfusion.Maui.Core.Internals.IToolbar.InvokeTappedEvent(SfToolbarItem toolbarItem, SfToolbarItem previousToolbarItem)
IMO, this seems like a Syncfusion issue. I would direct this to them first, as I think that's the issue's root. If it is MAUI, they can circle back.
@PureWeen @mattleibow what do you all think?
Yea, the error here is that a view is being removed from a layout that is no longer connected.
We do get the index as part of the remove command
so, in theory we could use the index vs the platform view to remove the view, but I do worry this just moves the exception down the pipeline. Because there shouldn't really be a path like this triggering.
from maui.
Related Issues (20)
- [MAUI] I1_Layout - The first row of Vertical list(RTL FlowDirection) isn't correctly aligned from right-to-left. HOT 1
- [MAUI]I5-EmptyView- filter not responding. HOT 2
- [MAUI] I3_Sizing -After making relevant changes, the image layout displays abnormally HOT 1
- [MAUI] I1_Layout - Horoizontal grid for DataTemplate & Horoizontal grid for Text pages display only three-rows grid. HOT 2
- [MAUI]When MesureFirstItem is selected, the image sizes of I3 and I6 are inconsistent. HOT 1
- [MAUI] I2_Spacing - Updating the vertical and horizontal spacing, the layout of the second column will change HOT 1
- [MAUI]I1_Layout-The window height on MacCatalyst must be adjusted to the maximum to scroll horizontally HOT 2
- [MAUI]I3_Sizing - 'MesaureAllItems 'and 'MesaureFirstItem ' Options not Responding in I3-Variable size items for Vertical list HOT 1
- [MAUI] Unable to scroll up and down HOT 2
- [MAUI] I2_Spacing - Changing the vertical and horizontal spacing values, images and location are truncated HOT 2
- [MAUI]I1_Layout-Horizontal list for Text page has too much blank space. HOT 1
- [MAUI] Height is not considered for ViewCell HOT 4
- `LoadFile` in `src/Core/src/Platform/iOS/MauiWKWebView.cs` ignore directories. HOT 2
- Android: Specific Avif image fails to load HOT 2
- Unable to click Label Spans position in CollectionView item HOT 2
- [iOS] ViewCell not resized when HasUnevenRows is enabled and cell content changes HOT 3
- `Element`: NRE by accessing `RealParent` HOT 2
- Setting background color on the Searchbar does nothing on iOS HOT 2
- Debugging MAUI gives "Could not found a valid Xcode app bundle at..." HOT 5
- [MAUI] I5_EmptyView - The data template selector cannot display the correct string. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from maui.