From 35302bd3d5828ab4af34fc6f38a20e4d0f5250d8 Mon Sep 17 00:00:00 2001 From: niimima Date: Sun, 21 Jan 2024 17:50:12 +0900 Subject: [PATCH] Fix pull request comments --- src/Maui/Prism.Maui/Navigation/INavigationService.cs | 7 ------- .../Navigation/INavigationServiceExtensions.cs | 10 +++++++++- .../Prism.Maui/Navigation/PageNavigationService.cs | 6 ------ 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/src/Maui/Prism.Maui/Navigation/INavigationService.cs b/src/Maui/Prism.Maui/Navigation/INavigationService.cs index 53759e964c..816199ca22 100644 --- a/src/Maui/Prism.Maui/Navigation/INavigationService.cs +++ b/src/Maui/Prism.Maui/Navigation/INavigationService.cs @@ -20,13 +20,6 @@ public interface INavigationService /// If true a go back operation was successful. If false the go back operation failed. Task GoBackAsync(INavigationParameters parameters); - /// - /// Navigates to the most recent entry in the back navigation history for the . - /// - /// The name of the View to navigate back to - /// If true a go back operation was successful. If false the go back operation failed. - Task GoBackAsync(string viewName); - /// /// Navigates to the most recent entry in the back navigation history for the . /// diff --git a/src/Maui/Prism.Maui/Navigation/INavigationServiceExtensions.cs b/src/Maui/Prism.Maui/Navigation/INavigationServiceExtensions.cs index 4930af712f..b38624fea9 100644 --- a/src/Maui/Prism.Maui/Navigation/INavigationServiceExtensions.cs +++ b/src/Maui/Prism.Maui/Navigation/INavigationServiceExtensions.cs @@ -20,7 +20,7 @@ public static Task GoBackToAsync(this INavigationService navi /// /// indicating whether the request was successful or if there was an encountered . public static Task GoBackAsync(this INavigationService navigationService) => - navigationService.GoBackAsync((INavigationParameters)null); + navigationService.GoBackAsync(new NavigationParameters()); /// /// Navigates to the most recent entry in the back navigation history by popping the calling Page off the navigation stack. @@ -33,6 +33,14 @@ public static Task GoBackAsync(this INavigationService naviga return navigationService.GoBackAsync(GetNavigationParameters(parameters)); } + /// + /// Navigates to the most recent entry in the back navigation history for the . + /// + /// Service for handling navigation between views + /// The name of the View to navigate back to + /// If true a go back operation was successful. If false the go back operation failed. + public static Task GoBackAsync(this INavigationService navigationService, string viewName) => navigationService.GoBackAsync(viewName, new NavigationParameters()); + /// /// When navigating inside a NavigationPage: Pops all but the root Page off the navigation stack /// diff --git a/src/Maui/Prism.Maui/Navigation/PageNavigationService.cs b/src/Maui/Prism.Maui/Navigation/PageNavigationService.cs index c505cacc18..e3aa9b89ce 100644 --- a/src/Maui/Prism.Maui/Navigation/PageNavigationService.cs +++ b/src/Maui/Prism.Maui/Navigation/PageNavigationService.cs @@ -181,12 +181,6 @@ public virtual async Task GoBackAsync(INavigationParameters p return Notify(NavigationRequestType.GoBack, parameters, GetGoBackException(page, GetPageFromWindow())); } - /// - public virtual async Task GoBackAsync(string viewName) - { - return await GoBackAsync(viewName, null); - } - /// public virtual async Task GoBackAsync(string viewName, INavigationParameters parameters) {