New page on router.push, old page on router.goBack

Hello, as we are building a large application, it is at times strongly preferred to completely remove and replace pages, instead of reusing them, having to reset all their state manually.

I have so far found ways to reuse all pages on push and goBack, and ways to replace all pages on push and goBack. What I have not found is a way to gain more control over when each of these happen. What I would like is to always get a new page on router.push, but always reuse the previous page on router.goBack.

How would I go about achieving this? Alternatively, how would I go about removing one or many/all pages, from JavaScript?

Hi Jacob.

You could put a Reuse="None" on the page you push as suggested in docs. This, however, applies to a given page disregarding which direction you go to it.

Other than that, you need to take care of the state manually. If thought out well, it shouldn’t be too bad. Forcing a non-reuse on a lot of pages would have a significant impact on your apps’ performance, since a lot of new page instances would have to be created.