Hello,
You can replace Page by setting a static instance for Window.
Please refer to the following code:
public partial class App : Application
{
public static Window WindowInstance { get; private set; }
public App()
{
InitializeComponent();
}
public static void Reset()
{
WindowInstance.Page = new MainPage();
}
protected override Window CreateWindow(IActivationState? activationState)
{
WindowInstance = new Window(new AppShell());
return WindowInstance;
}
}
Best Regards,
Alec Liu.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.