Hi Ben,
Thanks for contacting Syncfusion Support.
We checked your query and the shared code. From the code snippet, we are able to get that you are using SfPopupLayout in a wrong use case.
SfPopupLayout can only be the root of the page, but in your code snippet, you have added it as the child of the Grid, which is a wrong use case.
SfPopupLayout can be used in two ways,
Displaying pop-up when the SfPopupLayout is set as root view : Popup can be displayed when it is set as the root view of the page. Please refer the below UG link for more details on how to show popup when popup is the root view.
Displaying pop-up when the SfPopupLayout is not set as root view : Popup can be displayed by calling it on the fly, please refer the below UG link for more details on how to show popup on the fly.
We prepared the sample as per your requirement to display popup in the navigation page, where SfPopupLayout.IsOpen is binded to the property in the ViewModel. Please find the code snippet of the same below.
<ContentPage.BindingContext>
<local:ViewModel />
</ContentPage.BindingContext>
<sfpopup:SfPopupLayout x:Name="popup" IsOpen="{Binding DisplayPopup}">
<sfpopup:SfPopupLayout.Content>
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Button Grid.Row="0" Text="Click to open popup" Command="{BindingOpenPopupCommand}"/>
</Grid>
</sfpopup:SfPopupLayout.Content>
</sfpopup:SfPopupLayout> |
You can download the sample from the below link.
Regards,
Vigneshkumar R