You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
amosekr
changed the title
App crash open a popup
App crash when open a popup in windows
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(ElementChangedEventArgs
1 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.VisualElementRenderer
2.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.ViewHandler
2.SetVirtualView(IView view) at Microsoft.Maui.Handlers.BorderHandler.SetVirtualView(IView view) at Microsoft.Maui.Handlers.ViewHandler
2.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.ViewHandler
2.SetVirtualView(IView view) at Microsoft.Maui.Handlers.ContentViewHandler.SetVirtualView(IView view) at Microsoft.Maui.Handlers.ViewHandler
2.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
The text was updated successfully, but these errors were encountered: