Lukáš Matoušek
Lukáš Matoušek

Reputation: 35

How to trigger method on last when going to page page in xamarin?

I am will open page 2 from page 1. I will edit some info on page 2, then use Navigation.PopAsync() and I want to trigger method on Page 1 to refresh page 1 data. How can I do that in xamarin?

Upvotes: 0

Views: 114

Answers (1)

Wendy Zang - MSFT
Wendy Zang - MSFT

Reputation: 10958

You could do the refresh on Page1 via triggering the OnDisappearing on Page2.

Page2:

 async void Button_Clicked(object sender, EventArgs e)
    {
        await Navigation.PopAsync();
    }
    protected override void OnDisappearing()
    {
        base.OnDisappearing();
        //refresh(); 
    }

Upvotes: 1

Related Questions