Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disallow closing Rg Plugin popup in Xamarin Forms

I am using Rg Plugin popup for popup in Xamarin Forms application. I would like to disallow user from closing this popup. After some time, application will close this popup. Is it possible?

Why I need this: When user opens application for the first time, I would like to show usual start page and on top of it popup. Both are visible: in the middle there is popup and around it usual start page with grey overlay. In popup progress bar will be displayed while fetching data from server. User should not be able to close this popup. When fetching data is over, I would like to refresh start page and close this modal.

like image 663
Uros Avatar asked Apr 18 '17 12:04

Uros


1 Answers

As Dinesh kumar pointed out, 2 things need to be done - to disallow clicking on background and to disallow back button:

    public MyPopup()
    {
        InitializeComponent();

        CloseWhenBackgroundIsClicked = false;
    }

    protected override bool OnBackButtonPressed()
    {
        return true; // Disable back button
    }
like image 166
Uros Avatar answered Oct 08 '22 18:10

Uros