docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Interface IValidatableElement<TValue>

    Interface used on UI elements which handle value validation.

    Inherited Members
    INotifyValueChanged<TValue>.SetValueWithoutNotify(TValue)
    INotifyValueChanged<TValue>.value
    Namespace: Unity.AppUI.UI
    Assembly: Unity.AppUI.dll
    Syntax
    public interface IValidatableElement<TValue> : INotifyValueChanged<TValue>
    Type Parameters
    Name Description
    TValue

    The type of the value.

    Remarks

    Value validation implies the UI element has a value property, hence this interface inherits from UnityEngine.UIElements.INotifyValueChanged`1.

    Properties

    invalid

    True if the current value set on the UI element is invalid, False otherwise.

    Declaration
    bool invalid { get; set; }
    Property Value
    Type Description
    bool
    Remarks

    The invalid state is handled by the returned result of the validateValue function.

    validateValue

    Set this property to a reference of your custom function which will validate the current value of a UI element.

    Declaration
    Func<TValue, bool> validateValue { get; set; }
    Property Value
    Type Description
    Func<TValue, bool>
    Remarks

    This function will be invoked automatically by the UI element implementation in order to update the invalid state property.

    If the property is `null`, there wont be any validation process so by convention the `value` will be always valid.

    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)