Skip to content

Commit

Permalink
Reword description of INavigationResult
Browse files Browse the repository at this point in the history
The wording before suggested that if the navigation request was
unsuccessful there would be an exception captured; however, this is not
the case when navigation is attempted and CanNavigate is false. In this
case, Success would be false and Exception would be null.

The wording now does not make that suggestion.
  • Loading branch information
Adam-- committed Jun 18, 2021
1 parent a555223 commit f9cc1c1
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/Forms/Prism.Forms/Navigation/INavigationResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Prism.Navigation
{
/// <summary>
/// Provides navigation results indicating whether the navigation was successful or if there was an encountered <see cref="Exception"/>.
/// Provides navigation results indicating if the navigation was successful and any exceptions caught.
/// </summary>
public interface INavigationResult
{
Expand Down
12 changes: 6 additions & 6 deletions src/Forms/Prism.Forms/Navigation/INavigationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ public interface INavigationService
/// <summary>
/// Navigates to the most recent entry in the back navigation history by popping the calling Page off the navigation stack.
/// </summary>
/// <returns><see cref="INavigationResult"/> indicating whether the request was successful or if there was an encountered <see cref="Exception"/>.</returns>
/// <returns><see cref="INavigationResult"/> indicating whether the request was successful and any encountered <see cref="Exception"/>.</returns>
Task<INavigationResult> GoBackAsync();

/// <summary>
/// Navigates to the most recent entry in the back navigation history by popping the calling Page off the navigation stack.
/// </summary>
/// <param name="parameters">The navigation parameters</param>
/// <returns><see cref="INavigationResult"/> indicating whether the request was successful or if there was an encountered <see cref="Exception"/>.</returns>
/// <returns><see cref="INavigationResult"/> indicating whether the request was successful and any encountered <see cref="Exception"/>.</returns>
Task<INavigationResult> GoBackAsync(INavigationParameters parameters);

/// <summary>
Expand All @@ -28,14 +28,14 @@ public interface INavigationService
/// <param name="parameters">The navigation parameters</param>
/// <param name="useModalNavigation">If <c>true</c> uses PopModalAsync, if <c>false</c> uses PopAsync</param>
/// <param name="animated">If <c>true</c> the transition is animated, if <c>false</c> there is no animation on transition.</param>
/// <returns><see cref="INavigationResult"/> indicating whether the request was successful or if there was an encountered <see cref="Exception"/>.</returns>
/// <returns><see cref="INavigationResult"/> indicating whether the request was successful and any encountered <see cref="Exception"/>.</returns>
Task<INavigationResult> GoBackAsync(INavigationParameters parameters, bool? useModalNavigation, bool animated);

/// <summary>
/// When navigating inside a NavigationPage: Pops all but the root Page off the navigation stack
/// </summary>
/// <param name="parameters">The navigation parameters</param>
/// <returns><see cref="INavigationResult"/> indicating whether the request was successful or if there was an encountered <see cref="Exception"/>.</returns>
/// <returns><see cref="INavigationResult"/> indicating whether the request was successful and any encountered <see cref="Exception"/>.</returns>
/// <remarks>Only works when called from a View within a NavigationPage</remarks>
Task<INavigationResult> GoBackToRootAsync(INavigationParameters parameters);

Expand Down Expand Up @@ -79,7 +79,7 @@ public interface INavigationService
/// <param name="parameters">The navigation parameters</param>
/// <param name="useModalNavigation">If <c>true</c> uses PushModalAsync, if <c>false</c> uses PushAsync</param>
/// <param name="animated">If <c>true</c> the transition is animated, if <c>false</c> there is no animation on transition.</param>
/// <returns><see cref="INavigationResult"/> indicating whether the request was successful or if there was an encountered <see cref="Exception"/>.</returns>
/// <returns><see cref="INavigationResult"/> indicating whether the request was successful and any encountered <see cref="Exception"/>.</returns>
Task<INavigationResult> NavigateAsync(string name, INavigationParameters parameters, bool? useModalNavigation, bool animated);

/// <summary>
Expand All @@ -89,7 +89,7 @@ public interface INavigationService
/// <param name="parameters">The navigation parameters</param>
/// <param name="useModalNavigation">If <c>true</c> uses PopModalAsync, if <c>false</c> uses PopAsync</param>
/// <param name="animated">If <c>true</c> the transition is animated, if <c>false</c> there is no animation on transition.</param>
/// <returns><see cref="INavigationResult"/> indicating whether the request was successful or if there was an encountered <see cref="Exception"/>.</returns>
/// <returns><see cref="INavigationResult"/> indicating whether the request was successful and any encountered <see cref="Exception"/>.</returns>
/// <remarks>Navigation parameters can be provided in the Uri and by using the <paramref name="parameters"/>.</remarks>
/// <example>
/// NavigateAsync(new Uri("MainPage?id=3&amp;name=brian", UriKind.RelativeSource), parameters);
Expand Down
14 changes: 7 additions & 7 deletions src/Forms/Prism.Forms/Navigation/INavigationServiceExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public static void OnNavigationError(this Task<INavigationResult> navigationTask
/// </summary>
/// <param name="navigationService">The INavigationService instance</param>
/// <param name="parameters">The navigation parameters</param>
/// <returns><see cref="INavigationResult"/> indicating whether the request was successful or if there was an encountered <see cref="Exception"/>.</returns>
/// <returns><see cref="INavigationResult"/> indicating whether the request was successful and any encountered <see cref="Exception"/>.</returns>
/// <remarks>Only works when called from a View within a NavigationPage</remarks>
public static Task<INavigationResult> GoBackToRootAsync(this INavigationService navigationService, INavigationParameters parameters = null)
{
Expand Down Expand Up @@ -66,7 +66,7 @@ public static string GetNavigationUriPath(this INavigationService navigationServ
/// <param name="parameters">The navigation parameters</param>
/// <param name="useModalNavigation">If <c>true</c> uses PopModalAsync, if <c>false</c> uses PopAsync</param>
/// <param name="animated">If <c>true</c> the transition is animated, if <c>false</c> there is no animation on transition.</param>
/// <returns><see cref="INavigationResult"/> indicating whether the request was successful or if there was an encountered <see cref="Exception"/>.</returns>
/// <returns><see cref="INavigationResult"/> indicating whether the request was successful and any encountered <see cref="Exception"/>.</returns>
public static Task<INavigationResult> GoBackAsync(this INavigationService navigationService, INavigationParameters parameters = null, bool? useModalNavigation = null, bool animated = true)
{
return navigationService.GoBackAsync(parameters, useModalNavigation, animated);
Expand All @@ -80,7 +80,7 @@ public static Task<INavigationResult> GoBackAsync(this INavigationService naviga
/// <param name="parameters">The navigation parameters</param>
/// <param name="useModalNavigation">If <c>true</c> uses PushModalAsync, if <c>false</c> uses PushAsync</param>
/// <param name="animated">If <c>true</c> the transition is animated, if <c>false</c> there is no animation on transition.</param>
/// <returns><see cref="INavigationResult"/> indicating whether the request was successful or if there was an encountered <see cref="Exception"/>.</returns>
/// <returns><see cref="INavigationResult"/> indicating whether the request was successful and any encountered <see cref="Exception"/>.</returns>
public static Task<INavigationResult> NavigateAsync(this INavigationService navigationService, string name, INavigationParameters parameters = null, bool? useModalNavigation = null, bool animated = true)
{
return navigationService.NavigateAsync(name, parameters, useModalNavigation, animated);
Expand All @@ -91,7 +91,7 @@ public static Task<INavigationResult> NavigateAsync(this INavigationService navi
/// </summary>
/// <param name="navigationService">Service for handling navigation between views</param>
/// <param name="parameters">The navigation parameters</param>
/// <returns><see cref="INavigationResult"/> indicating whether the request was successful or if there was an encountered <see cref="Exception"/>.</returns>
/// <returns><see cref="INavigationResult"/> indicating whether the request was successful and any encountered <see cref="Exception"/>.</returns>
public static Task<INavigationResult> GoBackAsync(this INavigationService navigationService, params (string Key, object Value)[] parameters)
{
return navigationService.GoBackAsync(GetNavigationParameters(parameters));
Expand All @@ -103,7 +103,7 @@ public static Task<INavigationResult> GoBackAsync(this INavigationService naviga
/// <param name="navigationService">Service for handling navigation between views</param>
/// <param name="name">The Uri to navigate to</param>
/// <param name="parameters">The navigation parameters</param>
/// <returns><see cref="INavigationResult"/> indicating whether the request was successful or if there was an encountered <see cref="Exception"/>.</returns>
/// <returns><see cref="INavigationResult"/> indicating whether the request was successful and any encountered <see cref="Exception"/>.</returns>
/// <remarks>Navigation parameters can be provided in the Uri and by using the <paramref name="parameters"/>.</remarks>
/// <example>
/// NavigateAsync("MainPage?id=3&amp;name=dan", ("person", person), ("foo", bar));
Expand All @@ -121,7 +121,7 @@ public static Task<INavigationResult> NavigateAsync(this INavigationService navi
/// <param name="parameters">The navigation parameters</param>
/// <param name="useModalNavigation">If <c>true</c> uses PopModalAsync, if <c>false</c> uses PopAsync</param>
/// <param name="animated">If <c>true</c> the transition is animated, if <c>false</c> there is no animation on transition.</param>
/// <returns><see cref="INavigationResult"/> indicating whether the request was successful or if there was an encountered <see cref="Exception"/>.</returns>
/// <returns><see cref="INavigationResult"/> indicating whether the request was successful and any encountered <see cref="Exception"/>.</returns>
/// <remarks>Navigation parameters can be provided in the Uri and by using the <paramref name="parameters"/>.</remarks>
/// <example>
/// NavigateAsync(new Uri("MainPage?id=3&amp;name=brian", UriKind.RelativeSource), parameters);
Expand All @@ -137,7 +137,7 @@ public static Task<INavigationResult> NavigateAsync(this INavigationService navi
/// <param name="navigationService">Service for handling navigation between views</param>
/// <param name="uri">The Uri to navigate to</param>
/// <param name="parameters">The navigation parameters</param>
/// <returns><see cref="INavigationResult"/> indicating whether the request was successful or if there was an encountered <see cref="Exception"/>.</returns>
/// <returns><see cref="INavigationResult"/> indicating whether the request was successful and any encountered <see cref="Exception"/>.</returns>
/// <remarks>Navigation parameters can be provided in the Uri and by using the <paramref name="parameters"/>.</remarks>
/// <example>
/// NavigateAsync(new Uri("MainPage?id=3&amp;name=dan", UriKind.RelativeSource), ("person", person), ("foo", bar));
Expand Down
8 changes: 4 additions & 4 deletions src/Forms/Prism.Forms/Navigation/PageNavigationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public virtual Task<INavigationResult> GoBackAsync(INavigationParameters paramet
/// <param name="parameters">The navigation parameters</param>
/// <param name="useModalNavigation">If <c>true</c> uses PopModalAsync, if <c>false</c> uses PopAsync</param>
/// <param name="animated">If <c>true</c> the transition is animated, if <c>false</c> there is no animation on transition.</param>
/// <returns><see cref="INavigationResult"/> indicating whether the request was successful or if there was an encountered <see cref="Exception"/>.</returns>
/// <returns><see cref="INavigationResult"/> indicating whether the request was successful and any encountered <see cref="Exception"/>.</returns>
public virtual Task<INavigationResult> GoBackAsync(INavigationParameters parameters, bool? useModalNavigation, bool animated)
{
return GoBackInternal(parameters, useModalNavigation, animated);
Expand Down Expand Up @@ -182,7 +182,7 @@ private static bool IsMainPage(Page currentPage, Page mainPage)
/// When navigating inside a NavigationPage: Pops all but the root Page off the navigation stack
/// </summary>
/// <param name="parameters">The navigation parameters</param>
/// <returns><see cref="INavigationResult"/> indicating whether the request was successful or if there was an encountered <see cref="Exception"/>.</returns>
/// <returns><see cref="INavigationResult"/> indicating whether the request was successful and any encountered <see cref="Exception"/>.</returns>
/// <remarks>Only works when called from a View within a NavigationPage</remarks>
public virtual Task<INavigationResult> GoBackToRootAsync(INavigationParameters parameters)
{
Expand Down Expand Up @@ -264,7 +264,7 @@ public virtual Task<INavigationResult> NavigateAsync(string name, INavigationPar
/// <param name="parameters">The navigation parameters</param>
/// <param name="useModalNavigation">If <c>true</c> uses PushModalAsync, if <c>false</c> uses PushAsync</param>
/// <param name="animated">If <c>true</c> the transition is animated, if <c>false</c> there is no animation on transition.</param>
/// <returns><see cref="INavigationResult"/> indicating whether the request was successful or if there was an encountered <see cref="Exception"/>.</returns>
/// <returns><see cref="INavigationResult"/> indicating whether the request was successful and any encountered <see cref="Exception"/>.</returns>
public Task<INavigationResult> NavigateAsync(string name, INavigationParameters parameters, bool? useModalNavigation, bool animated)
{
return NavigateInternal(name, parameters, useModalNavigation, animated);
Expand Down Expand Up @@ -318,7 +318,7 @@ public virtual Task<INavigationResult> NavigateAsync(Uri uri, INavigationParamet
/// <param name="parameters">The navigation parameters</param>
/// <param name="useModalNavigation">If <c>true</c> uses PopModalAsync, if <c>false</c> uses PopAsync</param>
/// <param name="animated">If <c>true</c> the transition is animated, if <c>false</c> there is no animation on transition.</param>
/// <returns><see cref="INavigationResult"/> indicating whether the request was successful or if there was an encountered <see cref="Exception"/>.</returns>
/// <returns><see cref="INavigationResult"/> indicating whether the request was successful and any encountered <see cref="Exception"/>.</returns>
/// <remarks>Navigation parameters can be provided in the Uri and by using the <paramref name="parameters"/>.</remarks>
/// <example>
/// NavigateAsync(new Uri("MainPage?id=3&amp;name=brian", UriKind.RelativeSource), parameters);
Expand Down

0 comments on commit f9cc1c1

Please sign in to comment.