docs.unity3d.com
    Show / Hide Table of Contents

    Interface IValidatableElement<TValueType>

    Interface used on UI elements which handle value validation. Value validation implies the UI element has a value property, hence this interface inherits from UnityEngine.UIElements.INotifyValueChanged<T>.

    Inherited Members
    UnityEngine.UIElements.INotifyValueChanged<TValueType>.SetValueWithoutNotify(TValueType)
    UnityEngine.UIElements.INotifyValueChanged<TValueType>.value
    Namespace: Unity.AppUI.UI
    Syntax
    public interface IValidatableElement<TValueType> : INotifyValueChanged<TValueType>
    Type Parameters
    Name Description
    TValueType

    The type of the value.

    Properties

    invalid

    True if the current value set on the UI element is invalid, False otherwise. The invalid state is handled by the returned result of the validateValue function.

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

    validateValue

    Set this property to a reference of your custom function which will validate the current value of a UI element. 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.

    Declaration
    Func<TValueType, bool> validateValue { get; set; }
    Property Value
    Type Description
    Func<TValueType, Boolean>
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023