Class VisualElementExtensions
Extensions for VisualElement class.
Inherited Members
Namespace: UnityEngine.Dt.App.UI
Syntax
public static class VisualElementExtensions
Methods
GetChildren<T>(VisualElement, Boolean)
Get child elements of a given type.
Declaration
public static IEnumerable<T> GetChildren<T>(this VisualElement element, bool recursive)
where T : VisualElement
Parameters
Type | Name | Description |
---|---|---|
VisualElement | element | The parent element. |
Boolean | recursive | If true, the search will be recursive. |
Returns
Type | Description |
---|---|
IEnumerable<T> | A list of child elements of the given type. |
Type Parameters
Name | Description |
---|---|
T | The type of the child elements to search for. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | The VisualElement object can't be null. |
GetContext(VisualElement)
Get the current application context associated with the current VisualElement object.
Declaration
public static ApplicationContext GetContext(this VisualElement ve)
Parameters
Type | Name | Description |
---|---|---|
VisualElement | ve | The VisualElement object. |
Returns
Type | Description |
---|---|
ApplicationContext | The application context for this element. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | The provided VisualElement object must be not null. |
GetPanelSettings(IPanel)
Get the PanelSettings instance associated to this IPanel, if any.
Declaration
public static PanelSettings GetPanelSettings(this IPanel panel)
Parameters
Type | Name | Description |
---|---|---|
IPanel | panel | The IPanel object. |
Returns
Type | Description |
---|---|
PanelSettings | The PanelSettings instance if it exists, null otherwise. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | The IPanel object must not be null. |
GetPreferredTooltipPlacement(VisualElement)
Get the preferred placement for a VisualElement's Tooltip.
Declaration
public static PopoverPlacement GetPreferredTooltipPlacement(this VisualElement element)
Parameters
Type | Name | Description |
---|---|---|
VisualElement | element | The VisualElement which contains a tooltip. |
Returns
Type | Description |
---|---|
PopoverPlacement | The preferred placement, previously set using SetPreferredTooltipPlacement(VisualElement, PopoverPlacement) or the closest value set on a parent ContextProvider element. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | The VisualElement object can't be null. |
SetPreferredTooltipPlacement(VisualElement, PopoverPlacement)
Set a preferred Tooltip placement.
Declaration
public static void SetPreferredTooltipPlacement(this VisualElement element, PopoverPlacement placement)
Parameters
Type | Name | Description |
---|---|---|
VisualElement | element | The target visual element. |
PopoverPlacement | placement | The placement value. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | The VisualElement object can't be null. |