NavigationManagerUtils 0.0.2

dotnet add package NavigationManagerUtils --version 0.0.2                
NuGet\Install-Package NavigationManagerUtils -Version 0.0.2                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NavigationManagerUtils" Version="0.0.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NavigationManagerUtils --version 0.0.2                
#r "nuget: NavigationManagerUtils, 0.0.2"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// 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                

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

  1. In Code
    Use the [Inject] attribute:

    [Inject] private NavManUtils NavMan { get; set; }

  2. In Razor Components
    Use the @inject directive:

    @inject NavManUtils NavMan


Available Methods

  1. Navigate(string url, bool force = true)
    Navigate to the specified URL. The force parameter determines whether to reload the page even if already on the target URL.

  2. [DEPRECATED] Reload(bool force = true)
    Reload the current page. The force parameter determines whether to reload from the server.

  3. UrlHasParameters()
    Returns true if the current URL contains query parameters, otherwise false.

  4. GetUrlParameters(bool removeWhitespaceEntityInValue = false, bool removeWhitespaceEntityInKey = false)
    Retrieves the query parameters from the current URL as a Dictionary<string, string>.

    • removeWhitespaceEntityInValue: Strips %20 whitespace entities from parameter values.
    • removeWhitespaceEntityInKey: Strips %20 whitespace entities from parameter keys.
  5. GetNavMan()
    Provides access to the underlying NavigationManager 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.0.2 70 1/22/2025
0.0.1 379 2/10/2023

Upgrade to Core 8.0, renamed parameters, methods and switched to newest language code style.