Table of Contents

Class LazyField<T>

Namespace
The.WPF.Fields
Assembly
Instagile.WPF.dll

Used to defer creation of fields, breaking reference cycles

public sealed class LazyField<T> : LazyField, IField<T>, IField, IModel, INotifyPropertyChanged, IDataErrorInfo, IBoundField

Type Parameters

T
Inheritance
LazyField<T>
Implements
Inherited Members
Extension Methods

Constructors

LazyField(ISurface, Func<IField<T>>, PropertyInfo?)

public LazyField(ISurface surface, Func<IField<T>> valueFactory, PropertyInfo? metadata = null)

Parameters

surface ISurface
valueFactory Func<IField<T>>
metadata PropertyInfo

Properties

Content

Templated field content

public IField Content { get; }

Property Value

IField

HasChanges

public bool HasChanges { get; }

Property Value

bool

HasLabel

True if the field should be labelled inline

public bool HasLabel { get; }

Property Value

bool

HelpText

Optional tooltip, displayed if a label is also displayed

public string? HelpText { get; }

Property Value

string

IsEditable

public bool IsEditable { get; }

Property Value

bool

IsValid

public bool IsValid { get; }

Property Value

bool

IsVisible

True if the field should be displayed

public bool IsVisible { get; }

Property Value

bool

Label

Caption to display alongside the field content

public string Label { get; }

Property Value

string

Metadata

public PropertyInfo Metadata { get; }

Property Value

PropertyInfo

Text

Text summary of the field's value (for on screen summaries)

public string Text { get; }

Property Value

string

Value

The lensed value which this field is modelling

public T Value { get; set; }

Property Value

T

Methods

AddRule(Rule<T>, bool)

public void AddRule(Rule<T> rule, bool mayHaveDependencies)

Parameters

rule Rule<T>
mayHaveDependencies bool

ClearRules()

public void ClearRules()

Force()

public override void Force()

Invalidate()

Update the current value on the form, unless it has not been saved to the model, and perform validation

public void Invalidate()

SetFindings(IReadOnlyList<ValidationFinding>, IReadOnlyList<ValidationFinding>)

Display findings from a ValidationSession. anchored are pre-matched to this field's bound property with display policy applied, and merge with the field's own rules; descendants are the policy-filtered findings for the wider graph, which collection fields forward to their subscreens. Wrapping fields forward both to their content.

public void SetFindings(IReadOnlyList<ValidationFinding> anchored, IReadOnlyList<ValidationFinding> descendants)

Parameters

anchored IReadOnlyList<ValidationFinding>
descendants IReadOnlyList<ValidationFinding>