> ## Documentation Index
> Fetch the complete documentation index at: https://easyaf.nimbleapps.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# ViewModelBase

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

## Definition

**Assembly:** CloudNimble.BlazorEssentials.dll

**Namespace:** CloudNimble.BlazorEssentials

**Inheritance:** CloudNimble.BlazorEssentials.BlazorObservable

## Syntax

```csharp theme={"dark"}
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

### &#x20;.ctor

Creates a new instance of the `ViewModelBase`2\`.

#### Syntax

```csharp theme={"dark"}
public ViewModelBase(System.Net.Http.IHttpClientFactory httpClientFactory, TConfig configuration = default(TConfig), TAppState appState = null, CloudNimble.BlazorEssentials.StateHasChangedConfig stateHasChangedConfig = null)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `httpClientFactory` | `System.Net.Http.IHttpClientFactory` | The [IHttpClientFactory](https://learn.microsoft.com/dotnet/api/system.net.http.ihttpclientfactory) instance injected from the DI container. |
| `configuration` | `TConfig` | The *TConfig* instance injected from the DI container. |
| `appState` | `TAppState` | The *TAppState* instance injected from the DI container. |
| `stateHasChangedConfig` | `CloudNimble.BlazorEssentials.StateHasChangedConfig` | - |

### &#x20;.ctor Inherited

> [!NOTE]
>
> Inherited from `CloudNimble.BlazorEssentials.BlazorObservable`

Creates a new instance of the [BlazorObservable](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/BlazorObservable.md) class.

#### Syntax

```csharp theme={"dark"}
public BlazorObservable(CloudNimble.BlazorEssentials.StateHasChangedConfig stateHasChangedConfig = null)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `stateHasChangedConfig` | `CloudNimble.BlazorEssentials.StateHasChangedConfig` | - |

## Properties

### &#x20;AppState

The injected [AppStateBase](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/AppStateBase.md) instance for the ViewModel.

#### Syntax

```csharp theme={"dark"}
public TAppState AppState { get; internal set; }
```

#### Property Value

Type: `TAppState`

### &#x20;Configuration

The injected `ConfigurationBase` instance for the ViewModel.

#### Syntax

```csharp theme={"dark"}
public TConfig Configuration { get; internal set; }
```

#### Property Value

Type: `TConfig`

### &#x20;DelayDispatcher

#### Syntax

```csharp theme={"dark"}
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.

### &#x20;FilterCriteria

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

#### Syntax

```csharp theme={"dark"}
public string FilterCriteria { get; set; }
```

#### Property Value

Type: `string`

### &#x20;HttpClientFactory

The injected [IHttpClientFactory](https://learn.microsoft.com/dotnet/api/system.net.http.ihttpclientfactory) instance for the ViewModel.

#### Syntax

```csharp theme={"dark"}
public System.Net.Http.IHttpClientFactory HttpClientFactory { get; internal set; }
```

#### Property Value

Type: `System.Net.Http.IHttpClientFactory`

### &#x20;LoadingStatus Inherited

> [!NOTE]
>
> Inherited from `CloudNimble.BlazorEssentials.BlazorObservable`

A [BlazorObservable.LoadingStatus](https://easyaf.nimbleapps.cloud/blazoressentials/api-reference/CloudNimble/BlazorEssentials/BlazorObservable.md#loadingstatus) specifying the current state of the required data for this Observable.

#### Syntax

```csharp theme={"dark"}
public CloudNimble.BlazorEssentials.LoadingStatus LoadingStatus { get; set; }
```

#### Property Value

Type: `CloudNimble.BlazorEssentials.LoadingStatus`

### &#x20;StateHasChanged Inherited

> [!NOTE]
>
> Inherited from `CloudNimble.BlazorEssentials.BlazorObservable`

Determines how to trigger StateHasChanged events in a Blazor component.

#### Syntax

```csharp theme={"dark"}
public CloudNimble.BlazorEssentials.StateHasChangedConfig StateHasChanged { get; set; }
```

#### Property Value

Type: `CloudNimble.BlazorEssentials.StateHasChangedConfig`

## Methods

### &#x20;Dispose Override

> [!NOTE]
>
> Inherited from `CloudNimble.BlazorEssentials.BlazorObservable`

#### Syntax

```csharp theme={"dark"}
protected override void Dispose(bool disposing)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `disposing` | `bool` | - |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.