We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Null reference exception with tabview inside popup content

When I try to show the following it throws an exception. It happens when I put content inside any of the tab item If I remove content from tab items, no exception happens

                            <sfpopup:SfPopupLayout x:Name="popupLayout">
                                <sfpopup:SfPopupLayout.PopupView>
                                    <sfpopup:PopupView x:Name="popupView"
                                                       BindingContext="{x:Null}"
                                                       ShowHeader="False" 
                                                       ShowFooter="False"
                                                       WidthRequest="400"
                                                       HeightRequest="600"
                                                       AnimationMode="Fade">
                                        <sfpopup:PopupView.ContentTemplate>
                                            <DataTemplate>
                                                <sftabview:SfTabView BackgroundColor="White">
                                                    <sftabview:SfTabView.Items>
                                                        <sftabview:SfTabItem Title="Item 1">
                                                            <sftabview:SfTabItem.Content> // With the content inside a tab item throws an exception
                                                                <Label Text="Hello"/>
                                                            </sftabview:SfTabItem.Content>
                                                        </sftabview:SfTabItem>
                                                        <sftabview:SfTabItem Title="Item 2">
                                                        </sftabview:SfTabItem>
                                                        <sftabview:SfTabItem Title="Item 3">
                                                        </sftabview:SfTabItem>
                                                    </sftabview:SfTabView.Items>
                                                </sftabview:SfTabView>
                                            </DataTemplate>
                                        </sfpopup:PopupView.ContentTemplate>
                                    </sfpopup:PopupView>
                                </sfpopup:SfPopupLayout.PopupView>


                                <sfpopup:SfPopupLayout.Content>
                                    <Label Text="Some content"/>
                                </sfpopup:SfPopupLayout.Content>
                            </sfpopup:SfPopupLayout>


Exception message
---------------------------------
System.NullReferenceException: Object reference not set to an instance of an object.
   at Syncfusion.XForms.UWP.TabView.SfTabViewItem.OnApplyTemplate()
   at Windows.UI.Xaml.FrameworkElement.MeasureOverride(Size availableSize)
   at Windows.UI.Xaml.UIElement.Measure(Size availableSize)
   at Xamarin.Forms.Platform.UWP.VisualElementRenderer`2.MeasureOverride(Size availableSize)
   at Windows.UI.Xaml.FrameworkElement.MeasureOverride(Size availableSize)
   at Syncfusion.XForms.UWP.PopupLayout.PopupView.MeasureOverride(Size availableSize)
   at Windows.UI.Xaml.UIElement.Measure(Size availableSize)
   at Syncfusion.XForms.UWP.PopupLayout.VisualContainer.MeasureOverride(Size availableSize)
   at Windows.UI.Xaml.UIElement.Arrange(Rect finalRect)
   at Syncfusion.XForms.UWP.PopupLayout.PopupView.UpdatePopupView()
   at Syncfusion.XForms.UWP.PopupLayout.SfPopupLayout.DisplayPopup()
   at Syncfusion.XForms.UWP.PopupLayout.SfPopupLayout.set_IsOpen(Boolean value)
   at Syncfusion.XForms.UWP.PopupLayout.RendererHelper.MapSfPopupLayoutProperties(String propertyName, SfPopupLayout formsPopupLayout, SfPopupLayout nativePopupLayout)
   at Syncfusion.XForms.UWP.PopupLayout.SfPopupRenderer.OnElementPropertyChanged(Object sender, PropertyChangedEventArgs e)
   at System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
   at Xamarin.Forms.BindableObject.OnPropertyChanged(String propertyName)
   at Xamarin.Forms.Element.OnPropertyChanged(String propertyName)
   at Xamarin.Forms.BindableObject.SetValueActual(BindableProperty property, BindablePropertyContext context, Object value, Boolean currentlyApplying, SetValueFlags attributes, Boolean silent)
   at Xamarin.Forms.BindableObject.SetValueCore(BindableProperty property, Object value, SetValueFlags attributes, SetValuePrivateFlags privateAttributes)
   at Xamarin.Forms.BindableObject.SetValue(BindableProperty property, Object value, Boolean fromStyle, Boolean checkAccess)
   at Syncfusion.XForms.UWP.PopupLayout.SfPopupLayout.OpenOrClosePopup(Boolean open)
   at Syncfusion.XForms.UWP.PopupLayout.SfPopupLayout.Show()
   at Syncfusion.XForms.UWP.PopupLayout.PopupLayoutDependencyService.Show(Object nativeObject, SfPopupLayout formsPopup)
   at Syncfusion.XForms.PopupLayout.SfPopupLayout.Show()
---------------------------------

1 Reply

PA Paul Anderson S Syncfusion Team December 4, 2018 11:55 AM UTC

Hi, 
 
Greetings from Syncfusion. 
 
We checked the reported issue “Null reference exception occurs in tabview which is placed inside popup view” with the given code snippet and we are able to reproduce the reported issue in the 16.3.0.29 version. The reported issue has been fixed in the latest version (16.3.0.36), so please upgrade the SfTabView version to the latest version to resolve the reported issue. 
 
Regards, 
Paul Anderson 


Loader.
Live Chat Icon For mobile
Up arrow icon