Method GetLast
GetLast(UIDocument, TypeSearch, Predicate<VisualElement>)
Retrieves the lastVisualElement.
Declaration
public static VisualElement GetLast(this 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 | LastVisualElementretrieved. |
GetLast(UIDocument, string, TypeSearch, Predicate<VisualElement>)
Retrieves the lastVisualElementaccording to the filter applied via the selector.
Declaration
public static VisualElement GetLast(this UIDocument document, string selector, UIToolkitComponent.TypeSearch searchFrom = TypeSearch.Container, Predicate<VisualElement> predicate = null)
Parameters
Type | Name | Description |
---|---|---|
UIDocument | document | TheUIDocumentcontaining theTemplateContainerthat will be considered 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 | LastVisualElementretrieved according to the filter applied via the selector. |
GetLast<TResult>(UIDocument, TypeSearch, Predicate<TResult>)
Retrieves the last element.
Declaration
public static TResult GetLast<TResult>(this 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 | Last element retrieved. |
Type Parameters
Name | Description |
---|---|
TResult | Type of the result based on the class.VisualElement. |
GetLast<TResult>(UIDocument, string, TypeSearch, Predicate<TResult>)
Retrieves the last element according to the filter applied via the selector.
Declaration
public static TResult GetLast<TResult>(this UIDocument document, string selector, 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. |
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 | Last 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. |