Table of Contents

Class EditContextObservableValidatorExtensions

Namespace
Blazing.Mvvm.Components
Assembly
Blazing.Mvvm.dll

Provides extension methods for Microsoft.AspNetCore.Components.Forms.EditContext to enable MVVM validation support for models that inherit from CommunityToolkit.Mvvm.ComponentModel.ObservableValidator.

public static class EditContextObservableValidatorExtensions

Inheritance

Methods

CanHandleEditContextModel(EditContext)

Determines whether the MVVM validation handler can handle the model of the specified Microsoft.AspNetCore.Components.Forms.EditContext.

public static bool CanHandleEditContextModel(this EditContext editContext)

Parameters

editContext EditContext

The Microsoft.AspNetCore.Components.Forms.EditContext whose model is to be checked.

Returns

bool

true if the MVVM validation handler can handle the model of the Microsoft.AspNetCore.Components.Forms.EditContext; otherwise, false.

Exceptions

ArgumentNullException

Thrown if editContext is null.

EnableMvvmObservableValidation(EditContext)

Enables MVVM validation support for the specified Microsoft.AspNetCore.Components.Forms.EditContext when its model inherits from CommunityToolkit.Mvvm.ComponentModel.ObservableValidator.

public static IDisposable EnableMvvmObservableValidation(this EditContext editContext)

Parameters

editContext EditContext

The Microsoft.AspNetCore.Components.Forms.EditContext to enable validation for.

Returns

IDisposable

An IDisposable whose disposal will remove MVVM validation support from the Microsoft.AspNetCore.Components.Forms.EditContext.

Exceptions

ArgumentNullException

Thrown if editContext is null.