SyncFusion NavigationDrawer: Exception when using a RelativeLayout in ContentView of the navigation drawer at UWP
Simpliefied using the code sample https://help.syncfusion.com/xamarin/navigation-drawer/getting-started#initialize-sfnavigationdrawer, but with a RelativeLayout instead of Grid.
Code:
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
x:Class="Views.Navigation"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:navigationdrawer="clr-namespace:Syncfusion.SfNavigationDrawer.XForms;assembly=Syncfusion.SfNavigationDrawer.XForms">
<navigationdrawer:SfNavigationDrawer x:Name="navigationDrawer">
<navigationdrawer:SfNavigationDrawer.ContentView>
<RelativeLayout />
</navigationdrawer:SfNavigationDrawer.ContentView>
</navigationdrawer:SfNavigationDrawer>
</ContentPage>
Exception:
- Exception {"Object reference not set to an instance of an object."} System.Exception {System.NullReferenceException}
at Xamarin.Forms.RelativeLayout.OnSizeRequest(Double widthConstraint, Double heightConstraint)
at Xamarin.Forms.VisualElement.GetSizeRequest(Double widthConstraint, Double heightConstraint)
at Xamarin.Forms.Layout.GetSizeRequest(Double widthConstraint, Double heightConstraint)
at Xamarin.Forms.VisualElement.Measure(Double widthConstraint, Double heightConstraint, MeasureFlags flags)
at Syncfusion.SfNavigationDrawer.XForms.UWP.SfNavigationDrawerRenderer.ConvertFormsToNative(View view, SfNavigationDrawer navigationDrawer, Size csize)
at Syncfusion.SfNavigationDrawer.XForms.UWP.SfNavigationDrawerMapping.OnNavigationDrawerPropertiesChanged(String propertyName, SfNavigationDrawer formsNavigationDrawer, SfNavigationDrawer nativenavigationDrawer)
at Syncfusion.SfNavigationDrawer.XForms.UWP.SfNavigationDrawerRenderer.OnElementChanged(ElementChangedEventArgs`1 e)
at Xamarin.Forms.Platform.UWP.VisualElementRenderer`2.SetElement(VisualElement element)
at Xamarin.Forms.Platform.UWP.Platform.CreateRenderer(VisualElement element)
at Xamarin.Forms.Platform.UWP.VisualElementPackager.SetupVisualElement(VisualElement view)
at Xamarin.Forms.Platform.UWP.VisualElementPackager.Load()
at Xamarin.Forms.Platform.UWP.VisualElementRenderer`2.SetElement(VisualElement element)
at Xamarin.Forms.Platform.UWP.Platform.CreateRenderer(VisualElement element)
at Xamarin.Forms.Platform.UWP.VisualElementExtensions.GetOrCreateRenderer(VisualElement self)
at Xamarin.Forms.Platform.UWP.NavigationPageRenderer.SetPage(Page page, Boolean isAnimated, Boolean isPopping)
at Xamarin.Forms.NavigationPage.<PushAsyncInner>d__87.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Xamarin.Forms.NavigationPage.<PushAsync>d__57.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at WitTronics.Gfp.Application.<>c__DisplayClass82_0`1.<<ShowView>b__0>d.MoveNext() in C:\WitTronics\GFP_UserApp\Gfp\GfpUser\Application\Application.cs:line 501
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Threading.WinRTSynchronizationContextBase.Invoker.InvokeCore()