FRBDK/Glue/Glue/Utilities/LinqToVisualTree.cs
/// <summary>
/// Applies the given function to each of the items in the supplied
/// IEnumerable, which match the given type.
/// </summary>
Applies the given function to each of the items in the supplied
IEnumerable, which match the given type.
Applies the given function to each of the items in the supplied IEnumerable which match the given type .
public static IEnumerable<DependencyObject> DrillDown<T>(this IEnumerable<DependencyObject> items,
            Func<DependencyObject, IEnumerable<DependencyObject>> function)
            where T : DependencyObject
        {
            foreach (var item in items)
            {
                foreach (var itemChild in function(item))
                {
                    if (itemChild is T)
                    {
                        yield return (T)itemChild;
                    }
                }
            }
        }
public static IEnumerable < DependencyObject > DrillDown < T > ( this IEnumerable < DependencyObject > items , Func < DependencyObject , IEnumerable < DependencyObject > > function ) where T : DependencyObject { foreach ( var item in items ) { foreach ( var itemChild in function ( item ) ) { if ( itemChild is T ) { yield return ( T ) itemChild ; } } } }
Applies the given function to each of the items in the supplied
IEnumerable, which match the given type.
Applies the given function to each of the items in the supplied IEnumerable which match the given type .
IEnumerable<DependencyObject>
this
function
Func<DependencyObject, IEnumerable<DependencyObject>>