diff --git a/src/Shiny.Mediator.Prism/IPrismNavigationRequest.cs b/src/Shiny.Mediator.Prism/IPrismNavigationRequest.cs index 0368d85..a4a9819 100644 --- a/src/Shiny.Mediator.Prism/IPrismNavigationRequest.cs +++ b/src/Shiny.Mediator.Prism/IPrismNavigationRequest.cs @@ -1,7 +1,10 @@ namespace Shiny.Mediator; +// TODO: what about dialogs? public interface IPrismNavigationRequest : IRequest { + // contract can choose to open these up + string? PrependedNavigationUri { get; } string PageUri { get; } string? NavigationParameterName { get; } bool? IsAnimated { get; } diff --git a/src/Shiny.Mediator.Prism/Infrastructure/PrismNavigationRequestHandler.cs b/src/Shiny.Mediator.Prism/Infrastructure/PrismNavigationRequestHandler.cs index 67986bc..e388086 100644 --- a/src/Shiny.Mediator.Prism/Infrastructure/PrismNavigationRequestHandler.cs +++ b/src/Shiny.Mediator.Prism/Infrastructure/PrismNavigationRequestHandler.cs @@ -8,7 +8,10 @@ public async Task Handle(TRequest request, CancellationToken cancellationToken) var pn = request.NavigationParameterName ?? request.GetType().Name; var nav = request.Navigator ?? navigator; var tcs = new TaskCompletionSource(); + + var navUri = request.PrependedNavigationUri + request.PageUri; var navParams = new NavigationParameters(); + navParams.Add(pn, request); if (request.IsModal) @@ -21,7 +24,7 @@ public async Task Handle(TRequest request, CancellationToken cancellationToken) { try { - var result = await nav.NavigateAsync(request.PageUri, navParams); + var result = await nav.NavigateAsync(navUri, navParams); if (!result.Success) throw new InvalidOperationException("Failed to Navigate", result.Exception);