Show / Hide Table of Contents

Class DependencyObjectExtensions

Extension methods for System.Windows.DependencyObject.

Inheritance
System.Object
DependencyObjectExtensions
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Phoenix.Controls.Extensions
Assembly: Phoenix.Controls.dll
Syntax
public static class DependencyObjectExtensions

Methods

View Source

FindAncestor<T>(DependencyObject)

Gets the first visual parent of the given the type.

Declaration
public static T FindAncestor<T>(this DependencyObject self)
    where T : DependencyObject
Parameters
Type Name Description
System.Windows.DependencyObject self

The object with a parent.

Returns
Type Description
T

The parent, if it was found.

Type Parameters
Name Description
T

The parent type.

View Source

FindAncestorsUntil<T>(DependencyObject, T)

Gets all visual parents of the given the type, until the end is reached.

Declaration
public static IEnumerable<T> FindAncestorsUntil<T>(this DependencyObject self, T end = null)
    where T : DependencyObject
Parameters
Type Name Description
System.Windows.DependencyObject self

The object with a parent.

T end

The item to end the search. If null, search the entire tree.

Returns
Type Description
System.Collections.Generic.IEnumerable<T>

The parents, if any were found.

Type Parameters
Name Description
T

The parent type.

View Source

GetFirstVisualChild<T>(DependencyObject)

Gets the first visual child of the given the type.

Declaration
public static T GetFirstVisualChild<T>(this DependencyObject self)
    where T : DependencyObject
Parameters
Type Name Description
System.Windows.DependencyObject self

The object containing children.

Returns
Type Description
T

The child, if it was found.

Type Parameters
Name Description
T

The child type.

View Source

IsVisualOrVisual3D(DependencyObject)

Determines if the object is a System.Windows.Media.Visual or System.Windows.Media.Media3D.Visual3D.

Declaration
public static bool IsVisualOrVisual3D(this DependencyObject self)
Parameters
Type Name Description
System.Windows.DependencyObject self

The object.

Returns
Type Description
System.Boolean

A boolean.

  • View Source
In This Article
Back to top Generated by DocFX