Skip to main content

Definition

Assembly: CloudNimble.BlazorEssentials.dll Namespace: CloudNimble.BlazorEssentials Inheritance: CloudNimble.BlazorEssentials.BlazorObservable

Syntax

Summary

A base class to control application-wide state in a Blazor app.

Constructors

.ctor

Syntax

Parameters

.ctor Inherited

Inherited from CloudNimble.BlazorEssentials.BlazorObservable
Creates a new instance of the BlazorObservable class.

Syntax

Parameters

Properties

AuthenticationStateProvider

The AppStateBase.AuthenticationStateProvider instance for the application.

Syntax

Property Value

Type: Microsoft.AspNetCore.Components.Authorization.AuthenticationStateProvider

Remarks

This property correctly registers for and de-registers from AppStateBase.AuthenticationStateProvider events as the value is set, and automatically calls AppStateBase.RefreshClaimsPrincipal for you.

ClaimsPrincipal

The AppStateBase.ClaimsPrincipal returned from calling User.

Syntax

Property Value

Type: System.Security.Claims.ClaimsPrincipal

CurrentNavItem

The NavigationItem from AppStateBase.NavItems that corresponds to the current Route.

Syntax

Property Value

Type: CloudNimble.BlazorEssentials.Navigation.NavigationItem

Environment

The WebAssemblyHostEnvironment injected from the DI container.

Syntax

Property Value

Type: Microsoft.AspNetCore.Components.WebAssembly.Hosting.IWebAssemblyHostEnvironment

HttpClientFactory

The instance of the IHttpClientFactory injected by the DI system.

Syntax

Property Value

Type: System.Net.Http.IHttpClientFactory

IsClaimsPrincipalAuthenticated

Returns a value indicating whether or not the current AppStateBase.ClaimsPrincipalClaimsPrincipal’s</see> Identity is authenticated.

Syntax

Property Value

Type: bool

JSRuntime

Syntax

Property Value

Type: Microsoft.JSInterop.IJSRuntime

LoadingStatus Inherited

Inherited from CloudNimble.BlazorEssentials.BlazorObservable
A BlazorObservable.LoadingStatus specifying the current state of the required data for this Observable.

Syntax

Property Value

Type: CloudNimble.BlazorEssentials.LoadingStatus Allows the application to interact with the browser’s History API.

Syntax

Property Value

Type: CloudNimble.BlazorEssentials.Navigation.NavigationHistory

Remarks

This really should be a part of the NavigationManager, but what do we know? ¯_(ツ)_/¯ The instance of the AppStateBase.NavigationManager injected by the DI system.

Syntax

Property Value

Type: Microsoft.AspNetCore.Components.NavigationManager An ObservableCollection`1 containing the primary navigation details for the application.

Syntax

Property Value

Type: System.Collections.ObjectModel.ObservableCollection<CloudNimble.BlazorEssentials.Navigation.NavigationItem>

StateHasChanged Inherited

Inherited from CloudNimble.BlazorEssentials.BlazorObservable
Determines how to trigger StateHasChanged events in a Blazor component.

Syntax

Property Value

Type: CloudNimble.BlazorEssentials.StateHasChangedConfig

Methods

Dispose Override

Inherited from CloudNimble.BlazorEssentials.BlazorObservable

Syntax

Parameters

LoadNavItems

Load the NavigationItems into AppStateBase.NavItems and properly wire up the PropertyChanged event.

Syntax

Parameters

Navigates to the specified Uri and sets AppStateBase.CurrentNavItem to the matching NavigationItem in AppStateBase.NavItems.

Syntax

Parameters

Utilizes the injected AppStateBase.NavigationHistory History API to navigate to the last entry in the history stack, and attempts to set the AppStateBase.CurrentNavItem.

Syntax

Parameters

Returns

Type: System.Threading.Tasks.Task A Task representing the completion state of the operation.

Remarks

Will not throw an exception if you are at the bottom of the History stack. Utilizes the injected AppStateBase.NavigationHistory History API to navigate to the next entry in the history stack, and attempts to set the AppStateBase.CurrentNavItem.

Syntax

Parameters

Returns

Type: System.Threading.Tasks.Task A Task representing the completion state of the operation.

Remarks

Will not throw an exception if you are at the top of the History stack.

OpenInNewTab

Syntax

Parameters

Returns

Type: System.Threading.Tasks.Task

Remarks

https://stackoverflow.com/a/62769092

RefreshClaimsPrincipal

Tells the AuthenticationProvider to get the latest ClaimsPrincipal and run it through the internal AuthenticationStateChanged handler.

Syntax

Returns

Type: System.Threading.Tasks.Task A Task representing the completion state of the operation.

SetCurrentNavItem

Initializes AppStateBase.CurrentNavItem to the proper value based on the current route.

Syntax

SetCurrentNavItem

Initializes AppStateBase.CurrentNavItem to the proper value based on the current route.

Syntax

Parameters