Method GetFirst
GetFirst(VisualElement, TypeSearch, Predicate<VisualElement>)
Retrieves the firstVisualElement.
Declaration
public static VisualElement GetFirst(this VisualElement host, UIToolkitComponent.TypeSearch searchFrom = TypeSearch.Container, Predicate<VisualElement> predicate = null)
Parameters
Type | Name | Description |
---|---|---|
VisualElement | host | VisualElementconsidered as host. |
UIToolkitComponent.TypeSearch | searchFrom | Target children from the parent's container (indirect) or via the hierarchy (direct). |
Predicate<VisualElement> | predicate | Function to filter the result. |
Returns
Type | Description |
---|---|
VisualElement | FirstVisualElementretrieved. |
GetFirst(VisualElement, string, TypeSearch, Predicate<VisualElement>)
Retrieves the firstVisualElementaccording to the filter applied via the selector.
Declaration
public static VisualElement GetFirst(this VisualElement host, string selector, UIToolkitComponent.TypeSearch searchFrom = TypeSearch.Container, Predicate<VisualElement> predicate = null)
Parameters
Type | Name | Description |
---|---|---|
VisualElement | host | VisualElementconsidered as host. |
string | selector | The text to be parsed as a selector. |
UIToolkitComponent.TypeSearch | searchFrom | Target children from the parent's container (indirect) or via the hierarchy (direct). |
Predicate<VisualElement> | predicate | Function to filter the result. |
Returns
Type | Description |
---|---|
VisualElement | FirstVisualElementretrieve according to the filter applied via the selector. |
GetFirst(IEnumerable<VisualElement>, TypeSearch, Predicate<VisualElement>)
Retrieves the firstVisualElement.
Declaration
public static VisualElement GetFirst(this IEnumerable<VisualElement> hosts, UIToolkitComponent.TypeSearch searchFrom = TypeSearch.Container, Predicate<VisualElement> predicate = null)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<VisualElement> | hosts | List ofVisualElementconsidered as hosts. |
UIToolkitComponent.TypeSearch | searchFrom | Target children from the parent's container (indirect) or via the hierarchy (direct). |
Predicate<VisualElement> | predicate | Function to filter the result. |
Returns
Type | Description |
---|---|
VisualElement | FirstVisualElementretrieved. |
GetFirst(IEnumerable<VisualElement>, string, TypeSearch, Predicate<VisualElement>)
Retrieves the firstVisualElementaccording to the filter applied via the selector.
Declaration
public static VisualElement GetFirst(this IEnumerable<VisualElement> hosts, string selector, UIToolkitComponent.TypeSearch searchFrom = TypeSearch.Container, Predicate<VisualElement> predicate = null)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<VisualElement> | hosts | List ofVisualElementconsidered as hosts. |
string | selector | The text to be parsed as a selector. |
UIToolkitComponent.TypeSearch | searchFrom | Target children from the parent's container (indirect) or via the hierarchy (direct). |
Predicate<VisualElement> | predicate | Function to filter the result. |
Returns
Type | Description |
---|---|
VisualElement | FirstVisualElementretrieve according to the filter applied via the selector. |
GetFirst<TResult>(VisualElement, TypeSearch, Predicate<TResult>)
Retrieves the first element.
Declaration
public static TResult GetFirst<TResult>(this VisualElement host, UIToolkitComponent.TypeSearch searchFrom = TypeSearch.Container, Predicate<TResult> predicate = null) where TResult : VisualElement
Parameters
Type | Name | Description |
---|---|---|
VisualElement | host | VisualElementconsidered as host. |
UIToolkitComponent.TypeSearch | searchFrom | Target children from the parent's container (indirect) or via the hierarchy (direct). |
Predicate<TResult> | predicate | Function to filter the result. |
Returns
Type | Description |
---|---|
TResult | First element retrieved. |
Type Parameters
Name | Description |
---|---|
TResult | Type of the result based on the class.VisualElement. |
GetFirst<TResult>(VisualElement, string, TypeSearch, Predicate<TResult>)
Retrieves the first element according to the filter applied via the selector.
Declaration
public static TResult GetFirst<TResult>(this VisualElement host, string selector, UIToolkitComponent.TypeSearch searchFrom = TypeSearch.Container, Predicate<TResult> predicate = null) where TResult : VisualElement
Parameters
Type | Name | Description |
---|---|---|
VisualElement | host | VisualElementconsidered as host. |
string | selector | The text to be parsed as a selector. |
UIToolkitComponent.TypeSearch | searchFrom | Target children from the parent's container (indirect) or via the hierarchy (direct). |
Predicate<TResult> | predicate | Function to filter the result. |
Returns
Type | Description |
---|---|
TResult | First element retrieved according to the filter applied via the selector. |
Type Parameters
Name | Description |
---|---|
TResult | Type of the result based on the class.VisualElement. |
GetFirst<TResult>(IEnumerable<VisualElement>, TypeSearch, Predicate<TResult>)
Retrieves the first element.
Declaration
public static TResult GetFirst<TResult>(this IEnumerable<VisualElement> hosts, UIToolkitComponent.TypeSearch searchFrom = TypeSearch.Container, Predicate<TResult> predicate = null) where TResult : VisualElement
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<VisualElement> | hosts | List ofVisualElementconsidered as hosts. |
UIToolkitComponent.TypeSearch | searchFrom | Target children from the parent's container (indirect) or via the hierarchy (direct). |
Predicate<TResult> | predicate | Function to filter the result. |
Returns
Type | Description |
---|---|
TResult | First element retrieved. |
Type Parameters
Name | Description |
---|---|
TResult | Type of the result based on the class.VisualElement. |
GetFirst<TResult>(IEnumerable<VisualElement>, string, TypeSearch, Predicate<TResult>)
Retrieves the first element according to the filter applied via the selector.
Declaration
public static TResult GetFirst<TResult>(this IEnumerable<VisualElement> hosts, string selector, UIToolkitComponent.TypeSearch searchFrom = TypeSearch.Container, Predicate<TResult> predicate = null) where TResult : VisualElement
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<VisualElement> | hosts | List ofVisualElementconsidered as hosts. |
string | selector | The text to be parsed as a selector. |
UIToolkitComponent.TypeSearch | searchFrom | Target children from the parent's container (indirect) or via the hierarchy (direct). |
Predicate<TResult> | predicate | Function to filter the result. |
Returns
Type | Description |
---|---|
TResult | First element retrieved according to the filter applied via the selector. |
Type Parameters
Name | Description |
---|---|
TResult | Type of the result based on the class.VisualElement. |