C# Class Microsoft.Silverlight.Testing.Controls.VisualTreeExtensions

Provides useful extensions for working with the visual tree.
Since many of these extension methods are declared on types like DependencyObject high up in the class hierarchy, we've placed them in the Primitives namespace which is less likely to be imported for normal scenarios.
Show file Open project: garyjohnson/wpnest

Public Methods

Method Description
GetBoundsRelativeTo ( this element, UIElement otherElement ) : Rect?

Get the bounds of an element relative to another element.

GetVisualAncestors ( this element ) : IEnumerable

Get the visual tree ancestors of an element.

GetVisualAncestorsAndSelf ( this element ) : IEnumerable

Get the visual tree ancestors of an element and the element itself.

GetVisualChildren ( this element ) : IEnumerable

Get the visual tree children of an element.

GetVisualChildrenAndSelf ( this element ) : IEnumerable

Get the visual tree children of an element and the element itself.

GetVisualDescendants ( this element ) : IEnumerable

Get the visual tree descendants of an element.

GetVisualDescendantsAndSelf ( this element ) : IEnumerable

Get the visual tree descendants of an element and the element itself.

GetVisualSiblings ( this element ) : IEnumerable

Get the visual tree siblings of an element.

GetVisualSiblingsAndSelf ( this element ) : IEnumerable

Get the visual tree siblings of an element and the element itself.

InvokeOnLayoutUpdated ( this element, System.Action action ) : void

Perform an action when the element's LayoutUpdated event fires.

Private Methods

Method Description
GetLogicalChildren ( this parent ) : IEnumerable

Retrieves all the logical children of a framework element using a breadth-first search. For performance reasons this method manually manages the stack instead of using recursion.

GetLogicalDescendents ( this parent ) : IEnumerable

Retrieves all the logical descendents of a framework element using a breadth-first search. For performance reasons this method manually manages the stack instead of using recursion.

GetVisualAncestorsAndSelfIterator ( DependencyObject element ) : IEnumerable

Get the visual tree ancestors of an element and the element itself.

GetVisualChildrenAndSelfIterator ( this element ) : IEnumerable

Get the visual tree children of an element and the element itself.

GetVisualDescendantsAndSelfIterator ( DependencyObject element ) : IEnumerable

Get the visual tree descendants of an element and the element itself.

Method Details

GetBoundsRelativeTo() public static method

Get the bounds of an element relative to another element.
/// is null. /// /// is null. ///
public static GetBoundsRelativeTo ( this element, UIElement otherElement ) : Rect?
element this The element.
otherElement UIElement /// The element relative to the other element. ///
return Rect?

GetVisualAncestors() public static method

Get the visual tree ancestors of an element.
/// is null. ///
public static GetVisualAncestors ( this element ) : IEnumerable
element this The element.
return IEnumerable

GetVisualAncestorsAndSelf() public static method

Get the visual tree ancestors of an element and the element itself.
/// is null. ///
public static GetVisualAncestorsAndSelf ( this element ) : IEnumerable
element this The element.
return IEnumerable

GetVisualChildren() public static method

Get the visual tree children of an element.
/// is null. ///
public static GetVisualChildren ( this element ) : IEnumerable
element this The element.
return IEnumerable

GetVisualChildrenAndSelf() public static method

Get the visual tree children of an element and the element itself.
/// is null. ///
public static GetVisualChildrenAndSelf ( this element ) : IEnumerable
element this The element.
return IEnumerable

GetVisualDescendants() public static method

Get the visual tree descendants of an element.
/// is null. ///
public static GetVisualDescendants ( this element ) : IEnumerable
element this The element.
return IEnumerable

GetVisualDescendantsAndSelf() public static method

Get the visual tree descendants of an element and the element itself.
/// is null. ///
public static GetVisualDescendantsAndSelf ( this element ) : IEnumerable
element this The element.
return IEnumerable

GetVisualSiblings() public static method

Get the visual tree siblings of an element.
/// is null. ///
public static GetVisualSiblings ( this element ) : IEnumerable
element this The element.
return IEnumerable

GetVisualSiblingsAndSelf() public static method

Get the visual tree siblings of an element and the element itself.
/// is null. ///
public static GetVisualSiblingsAndSelf ( this element ) : IEnumerable
element this The element.
return IEnumerable

InvokeOnLayoutUpdated() public static method

Perform an action when the element's LayoutUpdated event fires.
/// is null. /// /// is null. ///
public static InvokeOnLayoutUpdated ( this element, System.Action action ) : void
element this The element.
action System.Action The action to perform.
return void