[WinUI] Grid Bug !!
See original GitHub issueDescription
Steps to Reproduce
https://github.com/dsuny/MauiApp1GridBug
Link to public reproduction project repository
https://github.com/dsuny/MauiApp1GridBug
Version with bug
7.0.86
Last version that worked well
6.0
Affected platforms
Windows
Affected platform versions
net7.0-windows10.0.19041.0
Did you find any workaround?
Padding value change
Relevant log output
Microsoft.Maui.IViewHandler: Error: Unexpected exception in OnHandlerChangedCore.
System.ArgumentException: Value does not fall within the expected range.
at WinRT.ExceptionHelpers.<ThrowExceptionForHR>g__Throw|20_0(Int32 hr)
at WinRT.ExceptionHelpers.ThrowExceptionForHR(Int32 hr)
at ABI.Microsoft.UI.Xaml.IDependencyObjectMethods.SetValue(IObjectReference _obj, DependencyProperty dp, Object value)
at Microsoft.UI.Xaml.DependencyObject.SetValue(DependencyProperty dp, Object value)
at Microsoft.Maui.Platform.ViewExtensions.UpdateProperty(FrameworkElement platformControl, DependencyProperty property, Object value)
at Microsoft.Maui.Platform.TextBlockExtensions.UpdatePadding(TextBlock platformControl, ILabel label)
at Microsoft.Maui.Handlers.LabelHandler.MapPadding(ILabelHandler handler, ILabel label)
at Microsoft.Maui.PropertyMapper2.<>c__DisplayClass5_0.<Add>b__0(IElementHandler h, IElement v) at Microsoft.Maui.PropertyMapper.UpdatePropertyCore(String key, IElementHandler viewHandler, IElement virtualView) 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.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.LayoutHandler.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.LayoutHandler.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
2.<>c__DisplayClass5_0.<Add>b__0(IElementHandler h, IElement v)
at Microsoft.Maui.PropertyMapper.UpdatePropertyCore(String key, IElementHandler viewHandler, IElement virtualView)
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.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.Platform.StackNavigationManager.OnNavigated(Object sender, NavigationEventArgs e)
at WinRT._EventSource_global__Microsoft_UI_Xaml_Navigation_NavigatedEventHandler.EventState.<GetEventInvoke>b__1_0(Object sender, NavigationEventArgs e)
at ABI.Microsoft.UI.Xaml.Navigation.NavigatedEventHandler.Do_Abi_Invoke(IntPtr thisPtr, IntPtr sender, IntPtr e)
— End of stack trace from previous location —
at WinRT.ExceptionHelpers.<ThrowExceptionForHR>g__Throw|20_0(Int32 hr)
at WinRT.ExceptionHelpers.ThrowExceptionForHR(Int32 hr)
at ABI.Microsoft.UI.Xaml.Controls.IFrameMethods.Navigate(IObjectReference _obj, Type sourcePageType, Object parameter, NavigationTransitionInfo infoOverride)
at Microsoft.UI.Xaml.Controls.Frame.Navigate(Type sourcePageType, Object parameter, NavigationTransitionInfo infoOverride)
at Microsoft.Maui.Platform.StackNavigationManager.NavigateTo(NavigationRequest args)
at Microsoft.Maui.Handlers.NavigationViewHandler.RequestNavigation(INavigationViewHandler arg1, IStackNavigation arg2, Object arg3)
at Microsoft.Maui.CommandMapper2.<>c__DisplayClass6_0.<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.NavigationPage.Microsoft.Maui.IStackNavigation.RequestNavigation(NavigationRequest eventArgs) at Microsoft.Maui.Controls.NavigationPage.SendHandlerUpdateAsync(Boolean animated, Action processStackChanges, Action firePostNavigatingEvents, Action fireNavigatedEvents) at Microsoft.Maui.TaskExtensions.FireAndForget(Task task, Action
1 errorCallback)
Issue Analytics
- State:
- Created 2 months ago
- Reactions:1
- Comments:9 (2 by maintainers)
@dsuny are you new to MAUI? I am a fan of MAUI.Blazor
do you want to be friends and help each other? do you have a Telegram app link. I am studying how to program while making my own libraries as a hobby
In my opinion, MAUI layout libraries should not throw exceptions, my philosophy is, if number crunching generates a result that doesn’t meet the expectation, just simply return default (what’s default is for specification)