Skip to content

Commit

Permalink
More prism arg improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
aritchie committed Oct 26, 2024
1 parent a2397ef commit 95f840b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/Shiny.Mediator.Prism/IPrismNavigationRequest.cs
Original file line number Diff line number Diff line change
@@ -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; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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);

Expand Down

0 comments on commit 95f840b

Please sign in to comment.