Is your feature request related to a problem? Please describe.
When navigating to a page, it doesn't always happen successfully. It would be good if the page/service performing the navigation, was able to handle the result.
Describe the solution you'd like
The navigation service methods could be updated to return Task<NavigationResult>. The result can be ignored if the caller wishes e.g.
Does the first line in the example above generate any warnings in compiler?
Describe alternatives you've considered
Try/catches on calls to navigation service.
Proposed APIs
If possible, try to propose how the API might look. For example:
// NavigationResult
public bool IsSuccess { get; }
public Exception Exception { get; }
Additional context
It is probably a good idea to support two different styles of error handling. This new method is one of them, another way is allowing any failed navigation to throw exceptions instead of returning a result.
Builder configuration: ThrowOnNavigationFailure, instead of catching a navigation exception and returning a result, it should rethrow the exception
Is your feature request related to a problem? Please describe. When navigating to a page, it doesn't always happen successfully. It would be good if the page/service performing the navigation, was able to handle the result.
Describe the solution you'd like The navigation service methods could be updated to return
Task<NavigationResult>
. The result can be ignored if the caller wishes e.g.Does the first line in the example above generate any warnings in compiler?
Describe alternatives you've considered Try/catches on calls to navigation service.
Proposed APIs If possible, try to propose how the API might look. For example:
Additional context It is probably a good idea to support two different styles of error handling. This new method is one of them, another way is allowing any failed navigation to throw exceptions instead of returning a result.
Builder configuration:
ThrowOnNavigationFailure
, instead of catching a navigation exception and returning a result, it should rethrow the exception