Pre-Load pages on xamarin forms

Published

I was searching for tricks to make my Xamarin Forms app faster, and I came across this article. Well, I have tried out some options there but I am finding it difficult to achieve the last option that says;

  • Pre-Load screens: This improved by a lot the performance on the app
    itself what we did is load on each screen, on background, the views
    and view-models that where needed next, so when pushing them onto the
    navigation stack they were already loaded. This reduced by a lot the
    time on transition between pages.

This seems to me as a good option and what I have done is to insert pages I maybe needing next onto the Stack before navigating to the page like so; however, I don’t know if I am doing this the right way.

    public ProductHomePageViewModel()
    {
        Application.Current.MainPage.Navigation.InsertPageBefore(new TilePage(), Application.Current.MainPage.Navigation.NavigationStack[0]);
    }

But this doesn’t work well when it is done on a homepage where a click of a back button should exit the app. But in this case clicking the back button navigates to the next page on the stack.

Please assist me on how to pre-load pages. Any advice is good. Thank you!

Source: Xamarin.ios Questions

Published
Categorised as Uncategorised Tagged , , , ,

Answers

Leave a Reply

Your email address will not be published. Required fields are marked *

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq