AppStateBase
A base class to control application-wide state in a Blazor app.Syntax
Inheritance
- object
EasyObservableObject
Implements
Constructors
AppStateBase
Parameters
- navigationManager NavigationManager: The Blazor
instance from the DI container. - httpClientFactory IHttpClientFactory: The
instance from the DI container. - jsRuntime IJSRuntime: The
instance from the DI container. - environment IWebAssemblyHostEnvironment: The
instance from the DI container. - navHistory NavigationHistory: The
instance from the DI container. - stateHasChangedConfig StateHasChangedConfig: The
instance from the DI container.
Properties
AuthenticationStateProvider
Returns
AuthenticationStateProviderClaimsPrincipal
Returns
ClaimsPrincipalCurrentNavItem
Returns
NavigationItemEnvironment
Returns
IWebAssemblyHostEnvironmentHttpClientFactory
Returns
IHttpClientFactoryIsClaimsPrincipalAuthenticated
Returns
boolJSRuntime
Returns
IJSRuntimeNavigationHistory
Returns
NavigationHistoryNavigationManager
Returns
NavigationManagerNavItems
Returns
ObservableCollection<NavigationItem>Methods
Dispose
Parameters
- disposing bool:
LoadNavItems
Parameters
- items List<NavigationItem>:
Navigate
Parameters
- uri string:
- setCurrentNavItem bool: Determines whether or not we should also set the CurrentNavItem. Usually this is no because the MainLayout should call AppState.SetCurrentNavItem in OnParametersSet. This parameter gives you flexibility without potentially calling it twice.
NavigateBackAsync
Parameters
- setCurrentNavItem bool: Determines whether or not we should also set the CurrentNavItem. Usually this is no because the MainLayout should call AppState.SetCurrentNavItem in OnParametersSet. This parameter gives you flexibility without potentially calling it twice.
Returns
Task ANavigateForwardAsync
Parameters
- setCurrentNavItem bool: Determines whether or not we should also set the CurrentNavItem. Usually this is no because the MainLayout should call AppState.SetCurrentNavItem in OnParametersSet. This parameter gives you flexibility without potentially calling it twice.
Returns
Task AOpenInNewTab
Parameters
- url string:
Returns
TaskRefreshClaimsPrincipal
Returns
Task ASetCurrentNavItem
SetCurrentNavItem
Parameters
- url string: