Back to Devexpress

SvgImageItem.FindDescendants(Predicate<SvgImageItem>) Method

windowsforms-devexpress-dot-xtraeditors-dot-svgimageitem-dot-finddescendants-x28-system-dot-predicate-devexpress-dot-xtraeditors-dot-svgimageitem-x29.md

latest3.8 KB
Original Source

SvgImageItem.FindDescendants(Predicate<SvgImageItem>) Method

Returns a list of the item’s descendants that match the specified condition.

Namespace : DevExpress.XtraEditors

Assembly : DevExpress.Utils.v25.2.dll

NuGet Packages : DevExpress.Utils, DevExpress.Wpf.Core

Declaration

csharp
public List<SvgImageItem> FindDescendants(
    Predicate<SvgImageItem> predicate
)
vb
Public Function FindDescendants(
    predicate As Predicate(Of SvgImageItem)
) As List(Of SvgImageItem)

Parameters

NameTypeDescription
predicatePredicate<SvgImageItem>

The search condition.

|

Returns

TypeDescription
List<SvgImageItem>

The list that contains found items.

|

Remarks

Example

The following code locates the hovered item’s descendant, whose ID starts with the “pressed” sub-string.

csharp
if (svgImageBox1.HoveredItem != null) {
    SvgImageItem item3 = svgImageBox1.HoveredItem.FindDescendants(i => i.Id != null && i.Id.StartsWith("pressed")).FirstOrDefault();
}
vb
If svgImageBox1.HoveredItem IsNot Nothing Then
    Dim item3 As SvgImageItem = svgImageBox1.HoveredItem.FindDescendants(Function(i) i.Id IsNot Nothing AndAlso i.Id.StartsWith("pressed")).FirstOrDefault()
End If

See Also

RootItems

Items

Parent

Root

Descendants

FindItemById(String)

FindItemByTag(Object)

FindItem(Predicate<SvgImageItem>)

FindItems(Predicate<SvgImageItem>)

FindAncestorById(String)

FindAncestorByTag(Object)

FindAncestors(Predicate<SvgImageItem>)

FindDescendantById(String)

FindDescendantByTag(Object)

FindDescendants(Predicate<SvgImageItem>)

SvgImageItem Class

SvgImageItem Members

DevExpress.XtraEditors Namespace