RunicValidationResult class

Namespace Runic.Application.Views in Runic.Application.Views 0.23.0

public class RunicValidationResult : ValidationResult, IRunicTextReferenceSource

Inherits or implements ValidationResult, IRunicTextReferenceSource.

A ValidationResult with a text reference, for DataAnnotations and CommunityToolkit ObservableValidator: return it from a ValidationAttribute or a CustomValidationAttribute method, and the page shows RunicValidationResult.Text in the window's language, with ValidationResult.ErrorMessage as the fallback.

Constructors

RunicValidationResult

public RunicValidationResult(string? errorMessage, RunicTextReference? text, IEnumerable<string>? memberNames = null)

Creates a result with a message, its text reference and the members it reports.

Parameters

errorMessage

The message, shown where the page cannot translate text.

text

The text reference.

memberNames

The members the result reports, as for ValidationResult.

RunicValidationResult

protected RunicValidationResult(RunicValidationResult validationResult)

Copies a result.

Properties

Text

public RunicTextReference? Text { get; }

The text reference, or null to show the message.

Documentation from IRunicTextReferenceSource.Text.