Skip to main content

Definition

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

Syntax

CloudNimble.BlazorEssentials.ViewModelBase<TConfig, TAppState>

Summary

A base class for your Blazor MVVM implementation that gives you access to all the useful stuff Blazor and BlazorEssentials inject into the app.

Type Parameters

  • TAppState -
  • TConfig -

Constructors

.ctor

Creates a new instance of the ViewModelBase2`.

Syntax

public ViewModelBase(System.Net.Http.IHttpClientFactory httpClientFactory, TConfig configuration = default(TConfig), TAppState appState = null, CloudNimble.BlazorEssentials.StateHasChangedConfig stateHasChangedConfig = null)

Parameters

NameTypeDescription
httpClientFactorySystem.Net.Http.IHttpClientFactoryThe IHttpClientFactory instance injected from the DI container.
configurationTConfigThe TConfig instance injected from the DI container.
appStateTAppStateThe TAppState instance injected from the DI container.
stateHasChangedConfigCloudNimble.BlazorEssentials.StateHasChangedConfig-

.ctor Inherited

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

Syntax

public BlazorObservable(CloudNimble.BlazorEssentials.StateHasChangedConfig stateHasChangedConfig = null)

Parameters

NameTypeDescription
stateHasChangedConfigCloudNimble.BlazorEssentials.StateHasChangedConfig-

Properties

AppState

The injected AppStateBase instance for the ViewModel.

Syntax

public TAppState AppState { get; internal set; }

Property Value

Type: TAppState

Configuration

The injected ConfigurationBase instance for the ViewModel.

Syntax

public TConfig Configuration { get; internal set; }

Property Value

Type: TConfig

DelayDispatcher

Syntax

public CloudNimble.BlazorEssentials.Threading.DelayDispatcher DelayDispatcher { get; }

Property Value

Type: CloudNimble.BlazorEssentials.Threading.DelayDispatcher

Remarks

This property is structured so that a new instance is not created unless specifically asked, to avoid unnecessary memory allocations.

FilterCriteria

Allows you to set any additional filtering criteria for this ViewModels’ HTTP requests from inside the Page itself.

Syntax

public string FilterCriteria { get; set; }

Property Value

Type: string

HttpClientFactory

The injected IHttpClientFactory instance for the ViewModel.

Syntax

public System.Net.Http.IHttpClientFactory HttpClientFactory { get; internal set; }

Property Value

Type: System.Net.Http.IHttpClientFactory

LoadingStatus Inherited

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

Syntax

public CloudNimble.BlazorEssentials.LoadingStatus LoadingStatus { get; set; }

Property Value

Type: CloudNimble.BlazorEssentials.LoadingStatus

StateHasChanged Inherited

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

Syntax

public CloudNimble.BlazorEssentials.StateHasChangedConfig StateHasChanged { get; set; }

Property Value

Type: CloudNimble.BlazorEssentials.StateHasChangedConfig

Methods

Dispose Override

Inherited from CloudNimble.BlazorEssentials.BlazorObservable

Syntax

protected override void Dispose(bool disposing)

Parameters

NameTypeDescription
disposingbool-