Thanks, I am looking forward to trying that out! As of this writing I got something working, but it's not 100% MVVM and actually quite strange. Initially I struggled setting the BidingContext, sorted that out and was able to show/hide the popup via databinding the "IsOpen" property. But solution was not stable.
Problem was when navigating to another page and then returning back to a new instance of this page, the popup opens, but when closed it fails to open again. I explicitly set the bounded DisplayPopup property to false in the ViewModel, but somehow I get this strange behaviour. So in a desperate moment I removed the IsOpen="{Binding DisplayPopup}" from the XAML (which I don't want to do), set the "IsOpen" to false when leaving the page and check if it is true when trying to show the popup, via a standard click event. This is really ugly and a hack that I want to avoid.
Part of my XAML:
<sfPopup:SfPopupLayout x:Name="popupLayout">
<sfPopup:SfPopupLayout.PopupView>
<sfPopup:PopupView x:Name="pop"
WidthRequest="220"
HeightRequest="280"
ShowFooter="false"
ShowHeader="false">
<sfPopup:PopupView.ContentTemplate>
<DataTemplate>
<Grid
Events that needs to be removed:
// Button click event
void Handle_Clicked(object sender, System.EventArgs e)
{
if (popupLayout.IsOpen)
popupLayout.IsOpen = false;
popupLayout.IsOpen = true;
}
// ContentPage
protected override void OnDisappearing()
{
popupLayout.IsOpen = false;
}