Exception when using a RelativeLayout in ContentView of the navigation drawer at UWP
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()
Greetings from Syncfusion.
We have analyzed your query and checked the reported issue of “Exception when using a RelativeLayout in ContentView of the navigation drawer at UWP”. In our SfNavigationDrawer source, we have just converted the Xamarin.Forms view to Native view only in UWP and we are not change anything related to layout. So, the reported crash occurs due to Xamarin.Forms framework. We will create bug report to Xamarin team and share the details of bug report on March 20th, 2020.
Regards,
Sakthivel P.
Thanks for your patience.
We have created issue in Xamarin.Forms discussion page, please find the link for your reference.
https://github.com/xamarin/Xamarin.Forms/issues/10050
Please let us know if you have any other queries.
Regards,
Sakthivel P.
- 2 Replies
- 2 Participants
-
JE Jeroen
- Mar 16, 2020 02:03 PM UTC
- Mar 22, 2020 04:12 PM UTC