Method GetFirst
GetFirst(UIDocument, TypeSearch, Predicate<VisualElement>)
Retrieves the firstVisualElementaccording to the filter applied via the selector.
Declaration
public VisualElement GetFirst(UIDocument document, UIToolkitComponent.TypeSearch searchFrom = TypeSearch.Container, Predicate<VisualElement> predicate = null)
Parameters
Type | Name | Description |
---|---|---|
UIDocument | document | TheUIDocumentcontaining theTemplateContainerthat will be considered 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 according to the filter applied via the selector. |
GetFirst(VisualElement, TypeSearch, Predicate<VisualElement>)
Retrieves the firstVisualElementaccording to the filter applied via the selector.
Declaration
public VisualElement GetFirst(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 | FirstVisualElementretrieve according to the filter applied via the selector. |
GetFirst(IEnumerable<VisualElement>, TypeSearch, Predicate<VisualElement>)
Retrieves the firstVisualElementaccording to the filter applied via the selector.
Declaration
public VisualElement GetFirst(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 | FirstVisualElementretrieve according to the filter applied via the selector. |
GetFirst<TResult>(IEnumerable<VisualElement>, TypeSearch, Predicate<TResult>)
Retrieves the first element according to the filter applied via the selector.
Declaration
public TResult GetFirst<TResult>(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 according to the filter applied via the selector. |
Type Parameters
Name | Description |
---|---|
TResult | Type of the result based on the class.VisualElement. |
GetFirst<TResult>(UIDocument, TypeSearch, Predicate<TResult>)
Retrieves the first element according to the filter applied via the selector.
Declaration
public TResult GetFirst<TResult>(UIDocument document, UIToolkitComponent.TypeSearch searchFrom = TypeSearch.Container, Predicate<TResult> predicate = null) where TResult : VisualElement
Parameters
Type | Name | Description |
---|---|---|
UIDocument | document | TheUIDocumentcontaining theTemplateContainerthat will be considered 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 according to the selector according to the filter applied via the selector. |
Type Parameters
Name | Description |
---|---|
TResult | Type of the result based on the class.VisualElement. |
GetFirst<TResult>(VisualElement, TypeSearch, Predicate<TResult>)
Retrieves the first element according to the filter applied via the selector.
Declaration
public TResult GetFirst<TResult>(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 according to the filter applied via the selector. |
Type Parameters
Name | Description |
---|---|
TResult | Type of the result based on the class.VisualElement. |