Saiyam Shah
Saiyam Shah

Reputation: 67

Xamarin.Forms Navigation (Memory Management)

Suppose I have 5 pages that I need to open one after another, and I don't want to go back actually. I can subscribe and unsubscribe the event on OnAppearing and OnDisAppearing to avoid memory leaks. But all the pages will be in the Navigation stack and it will consume memory. So how to remove those pages from memory, or how to efficiently navigate?

Upvotes: 0

Views: 145

Answers (1)

FreakyAli
FreakyAli

Reputation: 16479

As I understood you never have to go back in the Navigation Stack if that is the case the smart way would be to never create one and just change the MainPage property to the new page that you want to use something like below:

Application.Current.MainPage= new NewMainPage();

Upvotes: 1

Related Questions