RunicValidationMessage record

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

public sealed record RunicValidationMessage : IRunicTextReferenceSource, IEquatable<RunicValidationMessage>

Inherits or implements IRunicTextReferenceSource, IEquatable.

A structured validation error that a model may return from INotifyDataErrorInfo.GetErrors. Member paths are relative CLR property paths (for example Address.Postcode); the bridge resolves them through generated metadata before placing them on the wire. One message is emitted for each supplied member path.

Remarks

Set RunicValidationMessage.Text to a text reference, and the page shows the message in the window's language, with RunicValidationMessage.Message as the fallback:

new RunicValidationMessage("Title must be at most 80 characters.", "title-too-long")
{
    Text = RunicTextReference.Create(reference, TranslationReferenceJsonContext.Default.TranslationReference),
}

Constructors

RunicValidationMessage

public RunicValidationMessage(string Message, string? Code = null, string? Severity = null, IReadOnlyList<string>? MemberPaths = null)

A structured validation error that a model may return from INotifyDataErrorInfo.GetErrors. Member paths are relative CLR property paths (for example Address.Postcode); the bridge resolves them through generated metadata before placing them on the wire. One message is emitted for each supplied member path.

Remarks

Set RunicValidationMessage.Text to a text reference, and the page shows the message in the window's language, with RunicValidationMessage.Message as the fallback:

new RunicValidationMessage("Title must be at most 80 characters.", "title-too-long")
{
    Text = RunicTextReference.Create(reference, TranslationReferenceJsonContext.Default.TranslationReference),
}

Properties

Code

public string? Code { get; init; }

No documentation.

MemberPaths

public IReadOnlyList<string>? MemberPaths { get; init; }

No documentation.

Message

public string Message { get; init; }

No documentation.

Severity

public string? Severity { get; init; }

No documentation.

Text

public RunicTextReference? Text { get; init; }

The message as a text reference that the page shows in the window's language, or null to show RunicValidationMessage.Message. RunicValidationMessage.Message stays the fallback (the text of a validation error).