Fluent API for finding controls in visual or logical trees with complex query support. Provides chainable methods for building sophisticated control queries.
public class ControlFinder
kind:method, kind:property, kind:ctor. Press Esc to clear.ControlFinder(Visual)Creates a new ControlFinder starting from the specified root.All()Checks if all descendants match the filters (for verification).Any()Checks if any control matches the filters.AssignableFrom(Type)Filter to controls that are assignable from the specified type.ContainingPoint(Point)Filter by bounds containing a point.Count()Counts matching controls.Disabled()Filter to disabled controls only.EffectivelyEnabled()Filter to controls that are effectively enabled (enabled and all ancestors enabled).EffectivelyVisible()Filter to controls that are effectively visible (visible and all ancestors visible).Enabled()Filter to enabled controls only.ExactType<T>()Filter to controls that are exactly the specified type (not derived).Except(Func<Object, Boolean>)Exclude controls matching a predicate.Except<T>()Exclude controls of a specific type.FindAll()Finds all matching controls.FindAll<T>()Finds all matching controls of a specific type.FindFirst()Finds the first matching control.FindFirst<T>()Finds the first matching control of a specific type.Focusable()Filter to focusable controls only.Focused()Filter to focused controls only.From(Visual)Creates a ControlFinder for the specified root.GetFirst()Gets the first matching control, throwing if not found.GetFirst<T>()Gets the first matching control of a specific type, throwing if not found.Hidden()Filter to hidden controls only.HitTestable()Filter to controls that are hit-testable (IsHitTestVisible = true).IncludeSelf()Include the root element in the search.InLogicalTree()Search in the logical tree.IntersectingRect(Rect)Filter by bounds intersecting a rectangle.InVisualTree()Search in the visual tree (default).MaxDepth(Int32)Limit the search to a maximum depth.None()Checks if no controls match the filters.OfType<T>()Filter to only controls of the specified type.Single()Finds the single matching control (throws if 0 or more than 1).Single<T>()Finds the single matching control of a specific type.Skip(Int32)Skip a number of results.Take(Int32)Take only a limited number of results.Visible()Filter to visible controls only.Where(Func<Object, Boolean>)Add a custom filter predicate.Where<T>(Func<T, Boolean>)Add a typed custom filter predicate.WithAnyClass(String[])Filter by having any of the specified CSS classes.WithClass(String)Filter by having a specific CSS class.WithClasses(String[])Filter by having all specified CSS classes.WithContent<T>()Filter ContentControl by content type.WithDataContext(Object)Filter by DataContext value.WithDataContext<T>()Filter by DataContext type.WithDataContextProperty<TContext, TProperty>(Expression<Func<TContext, TProperty>>, TProperty)Filter by DataContext property value.WithItemCount(Int32)Filter ItemsControl by item count.WithMinHeight(Double)Filter by minimum height.WithMinItemCount(Int32)Filter ItemsControl by having at least a certain number of items.WithMinWidth(Double)Filter by minimum width.WithName(String)Filter by exact control name.WithNameContaining(String)Filter by name containing a substring.WithNameEndingWith(String)Filter by name ending with a suffix.WithNameMatching(String)Filter by name matching a pattern (supports * and ? wildcards).WithNameStartingWith(String)Filter by name starting with a prefix.WithoutClass(String)Filter by not having a specific CSS class.WithProperty<TProperty>(AvaloniaProperty<TProperty>, TProperty)Filter by Avalonia property value.WithProperty<TProperty>(AvaloniaProperty<TProperty>, Func<TProperty, Boolean>)Filter by property using a predicate.WithPseudoClass(String)Filter by pseudo-class state.WithTag(Object)Filter by Tag property value.WithText(String)Filter TextBlock/TextBox by text content.WithTextContaining(String)Filter TextBlock/TextBox by text containing a substring.