How to refresh the one but last ContentPage on the Navigation

前端 未结 3 1080
北海茫月
北海茫月 2020-12-19 13:37

Typically, one pops the current page using this from the NavigationStack:

   Navigation.PopAsync( true );

How to I use Naviga

3条回答
  •  春和景丽
    2020-12-19 14:31

    Here is what I had to do to get hvaughan3's solution to work for me:

    private async void OnGoToPage2Clicked(object sender, EventArgs args) {
        Page2 page2 = new Page2();
    
        page2.Disappearing += Page2_Disappearing;
    
        await Navigation.PushAsync(page2);
    }
    
    private void Page2_Disappearing(object sender, EventArgs e) {
        this.Refresh(); // what your refresh or init function is.
    }
    

    When I saw that solution I liked that as the option for me since I'm real heavy into using events to solve most of my problems. Thanks hvaughan3!

提交回复
热议问题