I know in Xamarin we can use Tabbed page, Carousel page... but I wonder that if I open every new page like this:
Application.Current.MainPage = new MyPage();
Is this a bad approach? Is this effect performance or any other things?
Basically when you use PushAsync
, it adds the new page on top of the navigation stack. The navigation stack is a LIFO you can manage using PushAsync
, PopAsync
or the back button. So when you use PopAsync
, it removes the last page from the stack (as it does using the back button).
Using Application.Current.MainPage = new MyPage();
for opening every page, you are just overriding the very first element of the stack and therefore you are not able to use back navigation at all since you would always keep one single page into the navigation stack.
Moreover, with this approach, clicking on the back button will exit the app.