NavigationManagerUtils 0.0.2
dotnet add package NavigationManagerUtils --version 0.0.2
NuGet\Install-Package NavigationManagerUtils -Version 0.0.2
<PackageReference Include="NavigationManagerUtils" Version="0.0.2" />
paket add NavigationManagerUtils --version 0.0.2
#r "nuget: NavigationManagerUtils, 0.0.2"
// Install NavigationManagerUtils as a Cake Addin #addin nuget:?package=NavigationManagerUtils&version=0.0.2 // Install NavigationManagerUtils as a Cake Tool #tool nuget:?package=NavigationManagerUtils&version=0.0.2
NavigationManagerUtils
Overview
NavigationManagerUtils is a very simple injectable service, created to enhance the capabilities of the NavigationManager
in Blazor applications. It provides additional utility methods that simplify navigation and URL parameter management.
Technologies Used
- .NET Core 8.0
Features
What is NavigationManagerUtils?
This is an injectable service for Blazor applications that builds upon the standard NavigationManager
, adding commonly-used features for navigation and URL management.
Example Usage
To see this utility in action, refer to the NavManUtilTest
project—a simple Blazor Server application that demonstrates its functionality.
Getting Started
Installation
Add the service to your application during configuration:
builder.Services.AddTransient<NavManUtils>();
Injecting the Service
In Code
Use the[Inject]
attribute:[Inject] private NavManUtils NavMan { get; set; }
In Razor Components
Use the@inject
directive:@inject NavManUtils NavMan
Available Methods
Navigate(string url, bool force = true)
Navigate to the specified URL. Theforce
parameter determines whether to reload the page even if already on the target URL.[DEPRECATED] Reload(bool force = true)
Reload the current page. Theforce
parameter determines whether to reload from the server.UrlHasParameters()
Returnstrue
if the current URL contains query parameters, otherwisefalse
.GetUrlParameters(bool removeWhitespaceEntityInValue = false, bool removeWhitespaceEntityInKey = false)
Retrieves the query parameters from the current URL as aDictionary<string, string>
.removeWhitespaceEntityInValue
: Strips %20 whitespace entities from parameter values.removeWhitespaceEntityInKey
: Strips %20 whitespace entities from parameter keys.
GetNavMan()
Provides access to the underlyingNavigationManager
instance without requiring separate injection.
License
This project is licensed under the GNU General Public License v3.0. For more details, visit GNU License.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
-
net8.0
- Microsoft.AspNetCore.Components.Web (>= 8.0.12)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Upgrade to Core 8.0, renamed parameters, methods and switched to newest language code style.