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

How to avoid running a code every time a page is viewed?

$
0
0

Hi,

In below code, I am populating list of customers when the page loaded first time:

protected override void OnAppearing()
{
    base.OnAppearing();

    GetCustomersList();
}

but my issue that every time I click on a customer to view its details on CustomerDetailsPage and the press back button it will again fire the GetCustomersList because that's the nature of OnAppearing

How to avoid that and make sure it's just fired on first time?

Any solution please?

Thanks,
Jassim


Viewing all articles
Browse latest Browse all 77050

Trending Articles



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