Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

Call back to parent view from modal

$
0
0

So I am trying to pop up a login window, then once they log in call back to the parent view and dismiss the modal. This is what I'm trying
Is is the main parent window
async void PatientButton_Clicked (object sender, EventArgs e)
{
await Navigation.PushModalAsync (new Login ());

        }

        public async void ReturnAndDismissLogin(User u)
        {
            this.View.User = u;
            await Navigation.PopModalAsync();
        }

And for simplicity's sake, here is my cancel button on the login view

    void CancelButton_Clicked (object sender, EventArgs e)
    {
        var home = (Home)this.ParentView;
        home.ReturnAndDismissLogin(new User());
    }

So when I try to reference this.Parent or this.ParentView they are null. How would I access the parent view? Or am I going about this the wrong way?


Viewing all articles
Browse latest Browse all 91519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>