Skip to content

Class UnaryCondition

Definition

Namespace: StardewUI.Framework.Binding
Assembly: StardewUI.dll

A condition based on a single value that is convertible to a Boolean.

public class UnaryCondition : StardewUI.Framework.Binding.ICondition, 
    System.IDisposable

Inheritance
Object ⇦ UnaryCondition

Implements
ICondition, IDisposable

Remarks

Passes whenever the value's boolean representation is true. Used for *if attributes.

Members

Constructors

Name Description
UnaryCondition(IValueSourceFactory, IValueConverterFactory, IResolutionScope, IAttribute) A condition based on a single value that is convertible to a Boolean.

Properties

Name Description
Context The context for evaluating the condition; i.e. the context of the node to which the condition applies.
Passed Whether or not the condition was passing as of the last Update().

Methods

Name Description
Dispose()
Update() Re-evaluates the condition and updates the Passed state.

Details

Constructors

UnaryCondition(IValueSourceFactory, IValueConverterFactory, IResolutionScope, IAttribute)

A condition based on a single value that is convertible to a Boolean.

public UnaryCondition(StardewUI.Framework.Sources.IValueSourceFactory valueSourceFactory, StardewUI.Framework.Converters.IValueConverterFactory valueConverterFactory, StardewUI.Framework.Content.IResolutionScope resolutionScope, StardewUI.Framework.Dom.IAttribute attribute);
Parameters

valueSourceFactory   IValueSourceFactory
The factory responsible for creating IValueSource<T> instances from attribute data.

valueConverterFactory   IValueConverterFactory
The factory responsible for creating IValueConverter<TSource, TDestination> instances, used to convert bound values to the types required by the target view.

resolutionScope   IResolutionScope
Scope for resolving externalized attributes, such as translation keys.

attribute   IAttribute
The attribute containing the conditional expression.

Remarks

Passes whenever the value's boolean representation is true. Used for *if attributes.


Properties

Context

The context for evaluating the condition; i.e. the context of the node to which the condition applies.

public StardewUI.Framework.Binding.BindingContext Context { get; set; }
Property Value

BindingContext


Passed

Whether or not the condition was passing as of the last Update().

public bool Passed { get; private set; }
Property Value

Boolean


Methods

Dispose()

public void Dispose();

Update()

Re-evaluates the condition and updates the Passed state.

public void Update();