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

App crash when open a popup in windows #146

Open
amosekr opened this issue Dec 13, 2024 · 0 comments
Open

App crash when open a popup in windows #146

amosekr opened this issue Dec 13, 2024 · 0 comments

Comments

@amosekr
Copy link

amosekr commented Dec 13, 2024

I am facing crash issues in windows maui apps in particular versions
I have created a custom dropdown control with help of mopup popups code base, we have dropdown UI when we click it we are displaying a mopup popup with list of dropdown values.
The use case is we are rendering the dropdown without selecting a value, we click a dropdown, popup opens with list of values, we select a value, popup closes and displaying selected value in dropdown
now if i click a dropdown app is crashing. This crash is happening only in this version windows devices "Windows 10 Enterprise LTSC, Version 1809"

if (mauiContext != null)
{
FrameworkElement ui= null;
try
{
ui = page.ToPlatform(mauiContext); This is the place where we are getting exception
}
catch (Exception ex)
{
}
renderer = (PopupPageRenderer)ui;
}
else
{
// Handle the case where MauiContext is null
Console.WriteLine("MauiContext is null.");
}

This is the exception we are getting
System.Runtime.InteropServices.COMException

at WinRT.ExceptionHelpers.g__Throw|38_0(Int32 hr)
at ABI.Microsoft.UI.Xaml.Controls.Primitives.ISelectorMethods.set_SelectedIndex(IObjectReference _obj, Int32 value)
at Microsoft.UI.Xaml.Controls.Primitives.Selector.set_SelectedIndex(Int32 value)
at Microsoft.Maui.Controls.Handlers.Compatibility.ListViewRenderer.OnElementItemSelected(Object sender, SelectedItemChangedEventArgs e)
at Microsoft.Maui.Controls.Handlers.Compatibility.ListViewRenderer.UpdateSelectionMode()
at Microsoft.Maui.Controls.Handlers.Compatibility.ListViewRenderer.OnElementChanged(ElementChangedEventArgs1 e) at Microsoft.Maui.Controls.Handlers.Compatibility.VisualElementRenderer2.SetVirtualView(IElement view, IPlatformViewHandler nativeViewHandler, Action1 onElementChanged, TElement& currentVirtualView, IPropertyMapper& _mapper, IPropertyMapper _defaultMapper, Boolean autoPackage) at Microsoft.Maui.Controls.Handlers.Compatibility.VisualElementRenderer2.Microsoft.Maui.IElementHandler.SetVirtualView(IElement view)
at Microsoft.Maui.Controls.Element.SetHandler(IElementHandler newHandler)
at Microsoft.Maui.Controls.Element.set_Handler(IElementHandler value)
at Microsoft.Maui.Controls.VisualElement.Microsoft.Maui.IElement.set_Handler(IElementHandler value)
at Microsoft.Maui.Platform.ElementExtensions.ToHandler(IElement view, IMauiContext context)
at Microsoft.Maui.Platform.ElementExtensions.ToPlatform(IElement view, IMauiContext context)
at Microsoft.Maui.Handlers.BorderHandler.UpdateContent(IBorderHandler handler)
at Microsoft.Maui.Handlers.BorderHandler.MapContent(IBorderHandler handler, IBorderView border)
at Microsoft.Maui.PropertyMapper.UpdateProperties(IElementHandler viewHandler, IElement virtualView)
at Microsoft.Maui.Handlers.ElementHandler.SetVirtualView(IElement view)
at Microsoft.Maui.Handlers.ViewHandler2.SetVirtualView(IView view) at Microsoft.Maui.Handlers.BorderHandler.SetVirtualView(IView view) at Microsoft.Maui.Handlers.ViewHandler2.SetVirtualView(IElement view)
at Microsoft.Maui.Controls.Element.SetHandler(IElementHandler newHandler)
at Microsoft.Maui.Controls.Element.set_Handler(IElementHandler value)
at Microsoft.Maui.Controls.VisualElement.Microsoft.Maui.IElement.set_Handler(IElementHandler value)
at Microsoft.Maui.Platform.ElementExtensions.ToHandler(IElement view, IMauiContext context)
at Microsoft.Maui.Platform.ElementExtensions.ToPlatform(IElement view, IMauiContext context)
at Microsoft.Maui.Handlers.ContentViewHandler.UpdateContent(IContentViewHandler handler)
at Microsoft.Maui.Handlers.ContentViewHandler.MapContent(IContentViewHandler handler, IContentView page)
at Microsoft.Maui.PropertyMapper.UpdateProperties(IElementHandler viewHandler, IElement virtualView)
at Microsoft.Maui.Handlers.ElementHandler.SetVirtualView(IElement view)
at Microsoft.Maui.Handlers.ViewHandler2.SetVirtualView(IView view) at Microsoft.Maui.Handlers.ContentViewHandler.SetVirtualView(IView view) at Microsoft.Maui.Handlers.ViewHandler2.SetVirtualView(IElement view)
at Microsoft.Maui.Controls.Element.SetHandler(IElementHandler newHandler)
at Microsoft.Maui.Controls.Element.set_Handler(IElementHandler value)
at Microsoft.Maui.Controls.VisualElement.Microsoft.Maui.IElement.set_Handler(IElementHandler value)
at Microsoft.Maui.Platform.ElementExtensions.ToHandler(IElement view, IMauiContext context)
at Microsoft.Maui.Platform.ElementExtensions.ToPlatform(IElement view, IMauiContext context)
at Windows.Implementation.PopupPlatformWindows.AddAsync(PopupPage page)
at Popup.Services.PopupNavigation.<>c__DisplayClass20_0.<g

Please help me to resolve this issue, if you have any workaround just share with me. Thanks in advance

@amosekr amosekr changed the title App crash open a popup App crash when open a popup in windows Dec 13, 2024
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

1 participant