A Microsoft framework for building cross-platform mobile apps using .NET and C# with native performance and user interfaces.
Hello,
Welcome to our Microsoft Q&A platform!
Xamarin.Forms doesn't provide the property to prevent closing the alert when clicking the background like 'Rg.Plugins.Popup' plugin. For this requirement, you could use the popup plugin to display the popup and set CloseWhenBackgroundIsClicked to true.
<pages:PopupPage
...
CloseWhenBackgroundIsClicked="False">
...
</pages:PopupPage>
Or customize a popup view and display it in the AbsoluteLayout. Then change the visibility of the view when clicking a button.
<AbsoluteLayout>
<ContentView x:Name="popupView" BackgroundColor="#C0808080" Padding="10, 0" IsVisible="false" AbsoluteLayout.LayoutBounds="0, 0, 1, 1" AbsoluteLayout.LayoutFlags="All">
<ContentView.Content>
<StackLayout VerticalOptions="Center" HorizontalOptions="Center">
<StackLayout Orientation="Vertical" HeightRequest="150" WidthRequest="200" BackgroundColor="White">
<Label x:Name="lblLoadingText" TextColor="Black" VerticalOptions="Center" HorizontalOptions="Center" VerticalTextAlignment="Center" Text="Loading..."></Label>
</StackLayout>
</StackLayout>
</ContentView.Content>
</ContentView>
<StackLayout AbsoluteLayout.LayoutFlags="All" AbsoluteLayout.LayoutBounds="0,0,1,1">
<!--the content-->
</StackLayout>
</AbsoluteLayout>
Best Regards,
Jarvan Zhang
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.