src/SaneDevelopment.WPF4.Controls/LinqToVisualTree/Extensions.cs
/// <summary>
/// Returns a collection of the after elements after this node, in document order.
/// </summary>
Returns a collection of the after elements after this node, in document order.
Returns a collection of the after elements after this node in document order .
public static IEnumerable<DependencyObject> ElementsAfterSelf(this DependencyObject item)
        {
            if (item.Ancestors().FirstOrDefault() == null)
                yield break;
            bool afterSelf = false;
            foreach (var child in item.Ancestors().First().Elements())
            {
                if (afterSelf)
                    yield return child;
                if (child.Equals(item))
                    afterSelf = true;
            }
        }
public static IEnumerable < DependencyObject > ElementsAfterSelf ( this DependencyObject item ) { if ( item . Ancestors ( ) . FirstOrDefault ( ) == null ) yield break ; bool afterSelf = false ; foreach ( var child in item . Ancestors ( ) . First ( ) . Elements ( ) ) { if ( afterSelf ) yield return child ; if ( child . Equals ( item ) ) afterSelf = true ; } }
Returns a collection of the after elements after this node, in document order.
Returns a collection of the after elements after this node in document order .
DependencyObject
this