Class PropertyElement | Properties UI | 1.4.4-preview.1
docs.unity3d.com
    Show / Hide Table of Contents

    Class PropertyElement

    Makes an element that can generate a UI hierarchy for a given target.

    Inheritance
    Object
    CallbackEventHandler
    Focusable
    VisualElement
    BindableElement
    PropertyElement
    Inherited Members
    BindableElement.binding
    BindableElement.bindingPath
    VisualElement.disabledUssClassName
    UnityEngine.UIElements.VisualElement.ExecuteDefaultAction(UnityEngine.UIElements.EventBase)
    UnityEngine.UIElements.VisualElement.Focus()
    VisualElement.SendEvent(EventBase)
    UnityEngine.UIElements.VisualElement.SetEnabledFromHierarchy(System.Boolean)
    VisualElement.SetEnabled(Boolean)
    VisualElement.MarkDirtyRepaint()
    UnityEngine.UIElements.VisualElement.ContainsPoint(UnityEngine.Vector2)
    UnityEngine.UIElements.VisualElement.Overlaps(UnityEngine.Rect)
    UnityEngine.UIElements.VisualElement.DoMeasure(System.Single, UnityEngine.UIElements.VisualElement.MeasureMode, System.Single, UnityEngine.UIElements.VisualElement.MeasureMode)
    UnityEngine.UIElements.VisualElement.ToString()
    VisualElement.GetClasses()
    UnityEngine.UIElements.VisualElement.ClearClassList()
    UnityEngine.UIElements.VisualElement.AddToClassList(System.String)
    UnityEngine.UIElements.VisualElement.RemoveFromClassList(System.String)
    VisualElement.ToggleInClassList(String)
    VisualElement.EnableInClassList(String, Boolean)
    UnityEngine.UIElements.VisualElement.ClassListContains(System.String)
    VisualElement.FindAncestorUserData()
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.Experimental.ITransitionAnimations.Start(System.Single, System.Single, System.Int32, System.Action<UnityEngine.UIElements.VisualElement, System.Single>)
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.Experimental.ITransitionAnimations.Start(UnityEngine.Rect, UnityEngine.Rect, System.Int32, System.Action<UnityEngine.UIElements.VisualElement, UnityEngine.Rect>)
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.Experimental.ITransitionAnimations.Start(UnityEngine.Color, UnityEngine.Color, System.Int32, System.Action<UnityEngine.UIElements.VisualElement, UnityEngine.Color>)
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.Experimental.ITransitionAnimations.Start(UnityEngine.Vector3, UnityEngine.Vector3, System.Int32, System.Action<UnityEngine.UIElements.VisualElement, UnityEngine.Vector3>)
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.Experimental.ITransitionAnimations.Start(UnityEngine.Vector2, UnityEngine.Vector2, System.Int32, System.Action<UnityEngine.UIElements.VisualElement, UnityEngine.Vector2>)
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.Experimental.ITransitionAnimations.Start(UnityEngine.Quaternion, UnityEngine.Quaternion, System.Int32, System.Action<UnityEngine.UIElements.VisualElement, UnityEngine.Quaternion>)
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.Experimental.ITransitionAnimations.Start(UnityEngine.UIElements.Experimental.StyleValues, UnityEngine.UIElements.Experimental.StyleValues, System.Int32)
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.Experimental.ITransitionAnimations.Start(System.Func<UnityEngine.UIElements.VisualElement, System.Single>, System.Single, System.Int32, System.Action<UnityEngine.UIElements.VisualElement, System.Single>)
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.Experimental.ITransitionAnimations.Start(System.Func<UnityEngine.UIElements.VisualElement, UnityEngine.Rect>, UnityEngine.Rect, System.Int32, System.Action<UnityEngine.UIElements.VisualElement, UnityEngine.Rect>)
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.Experimental.ITransitionAnimations.Start(System.Func<UnityEngine.UIElements.VisualElement, UnityEngine.Color>, UnityEngine.Color, System.Int32, System.Action<UnityEngine.UIElements.VisualElement, UnityEngine.Color>)
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.Experimental.ITransitionAnimations.Start(System.Func<UnityEngine.UIElements.VisualElement, UnityEngine.Vector3>, UnityEngine.Vector3, System.Int32, System.Action<UnityEngine.UIElements.VisualElement, UnityEngine.Vector3>)
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.Experimental.ITransitionAnimations.Start(System.Func<UnityEngine.UIElements.VisualElement, UnityEngine.Vector2>, UnityEngine.Vector2, System.Int32, System.Action<UnityEngine.UIElements.VisualElement, UnityEngine.Vector2>)
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.Experimental.ITransitionAnimations.Start(System.Func<UnityEngine.UIElements.VisualElement, UnityEngine.Quaternion>, UnityEngine.Quaternion, System.Int32, System.Action<UnityEngine.UIElements.VisualElement, UnityEngine.Quaternion>)
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.Experimental.ITransitionAnimations.Start(UnityEngine.UIElements.Experimental.StyleValues, System.Int32)
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.Experimental.ITransitionAnimations.Layout(UnityEngine.Rect, System.Int32)
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.Experimental.ITransitionAnimations.TopLeft(UnityEngine.Vector2, System.Int32)
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.Experimental.ITransitionAnimations.Size(UnityEngine.Vector2, System.Int32)
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.Experimental.ITransitionAnimations.Scale(System.Single, System.Int32)
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.Experimental.ITransitionAnimations.Position(UnityEngine.Vector3, System.Int32)
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.Experimental.ITransitionAnimations.Rotation(UnityEngine.Quaternion, System.Int32)
    VisualElement.Add(VisualElement)
    UnityEngine.UIElements.VisualElement.Insert(System.Int32, UnityEngine.UIElements.VisualElement)
    VisualElement.Remove(VisualElement)
    VisualElement.RemoveAt(Int32)
    VisualElement.Clear()
    VisualElement.ElementAt(Int32)
    VisualElement.IndexOf(VisualElement)
    VisualElement.Children()
    UnityEngine.UIElements.VisualElement.Sort(System.Comparison<UnityEngine.UIElements.VisualElement>)
    VisualElement.BringToFront()
    VisualElement.SendToBack()
    VisualElement.PlaceBehind(VisualElement)
    VisualElement.PlaceInFront(VisualElement)
    VisualElement.RemoveFromHierarchy()
    UnityEngine.UIElements.VisualElement.GetFirstOfType<T>()
    UnityEngine.UIElements.VisualElement.GetFirstAncestorOfType<T>()
    VisualElement.Contains(VisualElement)
    VisualElement.FindCommonAncestor(VisualElement)
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IVisualElementScheduler.Execute(System.Action<UnityEngine.UIElements.TimerState>)
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IVisualElementScheduler.Execute(System.Action)
    VisualElement.viewDataKey
    VisualElement.userData
    UnityEngine.UIElements.VisualElement.canGrabFocus
    UnityEngine.UIElements.VisualElement.focusController
    VisualElement.usageHints
    UnityEngine.UIElements.VisualElement.transform
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.ITransform.position
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.ITransform.rotation
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.ITransform.scale
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.ITransform.matrix
    UnityEngine.UIElements.VisualElement.layout
    UnityEngine.UIElements.VisualElement.contentRect
    UnityEngine.UIElements.VisualElement.paddingRect
    UnityEngine.UIElements.VisualElement.worldBound
    UnityEngine.UIElements.VisualElement.localBound
    UnityEngine.UIElements.VisualElement.worldTransform
    VisualElement.pickingMode
    UnityEngine.UIElements.VisualElement.name
    VisualElement.enabledInHierarchy
    VisualElement.enabledSelf
    UnityEngine.UIElements.VisualElement.visible
    VisualElement.generateVisualContent
    VisualElement.experimental
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IExperimentalFeatures.animation
    VisualElement.hierarchy
    UnityEngine.UIElements.VisualElement.cacheAsBitmap
    UnityEngine.UIElements.VisualElement.parent
    UnityEngine.UIElements.VisualElement.panel
    VisualElement.contentContainer
    UnityEngine.UIElements.VisualElement.Item[System.Int32]
    VisualElement.childCount
    VisualElement.schedule
    VisualElement.style
    VisualElement.customStyle
    VisualElement.styleSheets
    VisualElement.tooltip
    VisualElement.resolvedStyle
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.alignContent
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.alignItems
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.alignSelf
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.backgroundColor
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.backgroundImage
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.borderBottomColor
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.borderBottomLeftRadius
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.borderBottomRightRadius
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.borderBottomWidth
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.borderLeftColor
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.borderLeftWidth
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.borderRightColor
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.borderRightWidth
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.borderTopColor
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.borderTopLeftRadius
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.borderTopRightRadius
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.borderTopWidth
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.bottom
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.color
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.display
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.flexBasis
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.flexDirection
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.flexGrow
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.flexShrink
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.flexWrap
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.fontSize
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.height
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.justifyContent
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.left
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.marginBottom
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.marginLeft
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.marginRight
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.marginTop
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.maxHeight
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.maxWidth
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.minHeight
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.minWidth
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.opacity
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.paddingBottom
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.paddingLeft
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.paddingRight
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.paddingTop
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.position
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.right
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.textOverflow
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.top
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.unityBackgroundImageTintColor
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.unityBackgroundScaleMode
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.unityFont
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.unityFontStyleAndWeight
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.unitySliceBottom
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.unitySliceLeft
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.unitySliceRight
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.unitySliceTop
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.unityTextAlign
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.unityTextOverflowPosition
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.visibility
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.whiteSpace
    UnityEngine.UIElements.VisualElement.UnityEngine.UIElements.IResolvedStyle.width
    Focusable.Blur()
    Focusable.focusable
    Focusable.tabIndex
    Focusable.delegatesFocus
    UnityEngine.UIElements.CallbackEventHandler.RegisterCallback<TEventType>(UnityEngine.UIElements.EventCallback<TEventType>, UnityEngine.UIElements.TrickleDown)
    UnityEngine.UIElements.CallbackEventHandler.RegisterCallback<TEventType, TUserArgsType>(UnityEngine.UIElements.EventCallback<TEventType, TUserArgsType>, TUserArgsType, UnityEngine.UIElements.TrickleDown)
    UnityEngine.UIElements.CallbackEventHandler.UnregisterCallback<TEventType>(UnityEngine.UIElements.EventCallback<TEventType>, UnityEngine.UIElements.TrickleDown)
    UnityEngine.UIElements.CallbackEventHandler.UnregisterCallback<TEventType, TUserArgsType>(UnityEngine.UIElements.EventCallback<TEventType, TUserArgsType>, UnityEngine.UIElements.TrickleDown)
    CallbackEventHandler.HandleEvent(EventBase)
    CallbackEventHandler.HasTrickleDownHandlers()
    CallbackEventHandler.HasBubbleUpHandlers()
    UnityEngine.UIElements.CallbackEventHandler.ExecuteDefaultActionAtTarget(UnityEngine.UIElements.EventBase)
    Namespace: Unity.Properties.UI
    Syntax
    public sealed class PropertyElement : BindableElement, IEventHandler, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle, IBindable

    Constructors

    PropertyElement()

    Constructs an instance of PropertyElement.

    Declaration
    public PropertyElement()

    Methods

    AddContext(InspectionContext)

    Adds an inspection context to this element.

    Declaration
    public void AddContext(InspectionContext inspectionContext)
    Parameters
    Type Name Description
    InspectionContext inspectionContext

    The inspection context to add.

    Exceptions
    Type Condition
    NullReferenceException

    The inspection context is null.

    ClearTarget()

    Clears the current target and removes all child elements from this element's contentContainer.

    Declaration
    public void ClearTarget()

    ForceReload()

    Clears the current children and re-generates them.

    Declaration
    public void ForceReload()

    GetContext<T>(String)

    Returns an inspection context of the given type.

    Declaration
    public T GetContext<T>(string contextName = null)
        where T : InspectionContext
    Parameters
    Type Name Description
    String contextName

    The name of the inspection context.

    Returns
    Type Description
    T

    The inspection context, if it exists.

    Type Parameters
    Name Description
    T

    The inspection context type.

    GetTarget<T>()

    Gets the target of the PropertyElement as .

    Declaration
    public T GetTarget<T>()
    Returns
    Type Description
    T

    The instance of the target.

    Type Parameters
    Name Description
    T

    The type of the target.

    Exceptions
    Type Condition
    InvalidOperationException

    Thrown when no target has been set.

    InvalidCastException

    Thrown when the target is not of type .

    GetValue<TValue>(PropertyPath)

    Gets the value of type at the given path.

    Declaration
    public TValue GetValue<TValue>(PropertyPath path)
    Parameters
    Type Name Description
    PropertyPath path

    The property path to the value.

    Returns
    Type Description
    TValue

    The value at path.

    Type Parameters
    Name Description
    TValue

    The value type.

    Exceptions
    Type Condition
    InvalidOperationException

    Thrown when no target has been set.

    HasContext<T>(String)

    Returns true if an inspection context of the given type exists.

    Declaration
    public bool HasContext<T>(string contextName = null)
        where T : InspectionContext
    Parameters
    Type Name Description
    String contextName

    The name of the inspection context.

    Returns
    Type Description
    Boolean

    true, if it exists.

    Type Parameters
    Name Description
    T

    The inspection context type.

    IsPathValid(PropertyPath)

    Returns true if the given path is valid from the target.

    Declaration
    public bool IsPathValid(PropertyPath path)
    Parameters
    Type Name Description
    PropertyPath path

    the property path.

    Returns
    Type Description
    Boolean

    true if the path is valid.

    RemoveContext(InspectionContext)

    Removes an inspection context from this element.

    Declaration
    public void RemoveContext(InspectionContext inspectionContext)
    Parameters
    Type Name Description
    InspectionContext inspectionContext

    The inspection context to add.

    Exceptions
    Type Condition
    NullReferenceException

    The inspection context is null.

    ArgumentException

    The inspection context was not previously added.

    SetAttributeFilter(PropertyElement.AttributeFilterHandler)

    Allows to filter the hierarchy generation based on the field's attributes.

    Declaration
    public void SetAttributeFilter(PropertyElement.AttributeFilterHandler filter)
    Parameters
    Type Name Description
    PropertyElement.AttributeFilterHandler filter

    The filter method to apply.

    SetTarget<T>(T)

    Sets the current target.

    Declaration
    public void SetTarget<T>(T target)
    Parameters
    Type Name Description
    T target

    The target to set.

    Type Parameters
    Name Description
    T

    The type of the target.

    Remarks

    This will clear current hierarchy and regenerate a new one.

    SetValue<TValue>(PropertyPath, TValue)

    Sets the value of type at the given path.

    Declaration
    public void SetValue<TValue>(PropertyPath path, TValue value)
    Parameters
    Type Name Description
    PropertyPath path

    The property path to the value.

    TValue value

    the value we want to set.

    Type Parameters
    Name Description
    TValue

    The value type.

    Exceptions
    Type Condition
    InvalidOperationException

    Thrown when no target has been set.

    TryGetTarget<T>(out T)

    Tries to get the target of the PropertyElement as an instance of type .

    Declaration
    public bool TryGetTarget<T>(out T target)
    Parameters
    Type Name Description
    T target

    The target instance.

    Returns
    Type Description
    Boolean

    true if target was of the correct type; false otherwise.

    Type Parameters
    Name Description
    T

    The type of the target.

    TryGetValue<TValue>(PropertyPath, out TValue)

    Tries to get the value of type at the given path.

    Declaration
    public bool TryGetValue<TValue>(PropertyPath path, out TValue value)
    Parameters
    Type Name Description
    PropertyPath path

    The property path to the value.

    TValue value

    The value at path.

    Returns
    Type Description
    Boolean

    true if the getting the value was successful.

    Type Parameters
    Name Description
    TValue

    The value type.

    TrySetValue<TValue>(PropertyPath, TValue)

    Tries to set the value of type at the given path.

    Declaration
    public bool TrySetValue<TValue>(PropertyPath path, TValue value)
    Parameters
    Type Name Description
    PropertyPath path

    The property path to the value.

    TValue value

    the value we want to set.

    Returns
    Type Description
    Boolean

    The value that was effectively set.

    Type Parameters
    Name Description
    TValue

    The value type.

    Events

    OnChanged

    Register to this event to be notified when a change is detected.

    Declaration
    public event PropertyElement.ChangeHandler OnChanged
    Event Type
    Type Description
    PropertyElement.ChangeHandler
    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