nft-faucet/NftFaucet/Extensions/NavigationManagerExtensions.cs

21 lines
505 B
C#
Raw Normal View History

2022-04-03 22:30:06 +02:00
using Microsoft.AspNetCore.Components;
namespace NftFaucet.Extensions;
public static class NavigationManagerExtensions
{
public static void NavigateToRelative(this NavigationManager uriHelper, string relativePath)
{
var newUri = uriHelper.BaseUri;
if (!newUri.EndsWith("/"))
newUri += "/";
if (relativePath.StartsWith("/"))
relativePath = relativePath.Substring(1);
newUri += relativePath;
uriHelper.NavigateTo(newUri);
}
}