I have a custom button control where when the text is set, the text width is measured and the button width is adjusted. When this happens I get a Null reference exception on a ListDictionaryInternal somewhere in the layout code. When the text is set in the xaml the exception does not happen. I am hoping for some insight from the Xamarin team who might know where and why this is happening.
The exception started happening on Android only when I migrated my Forms PCL project to .NET Standard 2.0. Now it happens when I am targeting PCL 4.5 - Profile111 and it also happens on iOS.
Where would a ListDictionaryInternal be used in the Forms layout process?
Thanks!
I would post a pic for the full stack trace but... "You have to be around for a little while longer before you can post links." Really?
Looking at the Xamarin source code, it looks like the exception is being thrown on this line as shown below;
LayoutChildIntoBoundingRegion(child, layoutInformationCopy.Plots[i], layoutInformationCopy.Requests[i]);
Source: Xamarin.Forms.Core
at Xamarin.Forms.StackLayout.LayoutChildren (System.Double x, System.Double y, System.Double width, System.Double height) [0x00092] in C:\agent_work\1\s\Xamarin.Forms.Core\StackLayout.cs:66
at Xamarin.Forms.Layout.UpdateChildrenLayout () [0x0014b] in C:\agent_work\1\s\Xamarin.Forms.Core\Layout.cs:245
at Xamarin.Forms.Layout.OnSizeAllocated (System.Double width, System.Double height) [0x0000f] in C:\agent_work\1\s\Xamarin.Forms.Core\Layout.cs:205
at Xamarin.Forms.VisualElement.SizeAllocated (System.Double width, System.Double height) [0x00000] in C:\agent_work\1\s\Xamarin.Forms.Core\VisualElement.cs:637
at Xamarin.Forms.Layout+<>c.b__40_0 () [0x00080] in C:\agent_work\1\s\Xamarin.Forms.Core\Layout.cs:346
at Foundation.NSAsyncActionDispatcher.Apply () [0x00000] in /Users/builder/data/lanes/5665/f70a1348/source/xamarin-macios/src/Foundation/NSAction.cs:163