Hello,
When the NewPatient page opens the ContentPage, how can I close the NewPatient?
Do you want to remove the NewPatient
page in the navigation task? If so, you can use
Shell.Current.Navigation.RemovePage(yourNewPatient);` to move it,
Here is a demo code, If I want to remove NewPatient page in the PatientDetails.
var myExistingPageList = Shell.Current.Navigation.NavigationStack.ToList();
foreach (var item in myExistingPageList)
{
if (item != null)
{
if (item.GetType().Equals(typeof(NewPatient)))
{
Shell.Current.Navigation.RemovePage(item);
}
}
}
Please note: I use VS community 17.4.0, it is not working. If I execute it in 17.3.0, it is working.
Best Regards,
Leon Lu
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.