Show / Hide Table of Contents

Class DependencyObjectExtensions

Extensions for DependencyObjects

Inheritance
object
DependencyObjectExtensions
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Sartorius.SAF.Presentation.Extensions
Assembly: Sartorius.SAF.Presentation.dll
Syntax
public static class DependencyObjectExtensions

Methods

View Source

FindAncestor<T>(DependencyObject)

Finds the ancestor of the specified type in the visual tree.

Declaration
public static T FindAncestor<T>(this DependencyObject dependencyObject) where T : class
Parameters
Type Name Description
DependencyObject dependencyObject

The dependency object.

Returns
Type Description
T

The ancestor of the specified type, or null if not found

Type Parameters
Name Description
T

The type of the ancestor

View Source

FindFirstChildByType<T>(DependencyObject)

Finds the first child of type.

Declaration
public static T FindFirstChildByType<T>(this DependencyObject parent) where T : DependencyObject
Parameters
Type Name Description
DependencyObject parent

The parent.

Returns
Type Description
T

Null if not found, otherwise the child

Type Parameters
Name Description
T

The type of the child to find

View Source

FindLogicalAncestor<T>(DependencyObject)

Finds the ancestor of the specified type in the logical tree.

Declaration
public static T FindLogicalAncestor<T>(this DependencyObject dependencyObject) where T : class
Parameters
Type Name Description
DependencyObject dependencyObject

The dependency object.

Returns
Type Description
T

The ancestor of the specified type, or null if not found

Type Parameters
Name Description
T

The type of the ancestor

View Source

GetChildrenByType<T>(DependencyObject)

Finds the children of the specified type.

Declaration
public static IEnumerable<T> GetChildrenByType<T>(this DependencyObject parent) where T : DependencyObject
Parameters
Type Name Description
DependencyObject parent

The parent.

Returns
Type Description
IEnumerable<T>

Empty if not found, otherwise the children

Type Parameters
Name Description
T

The type of the children to find.

View Source

GetContainer(DependencyObject)

Gets the value of the Sartorius.SAF.Presentation.Extensions.Composition.Container attached property from a given DependencyObject.

Declaration
public static CompositionContainer GetContainer(this DependencyObject element)
Parameters
Type Name Description
DependencyObject element

The element from which to read the property value.

Returns
Type Description
CompositionContainer

The value of the Sartorius.SAF.Presentation.Extensions.Composition.Container attached property.

View Source

SetContainer(DependencyObject, CompositionContainer)

Sets the value of the Sartorius.SAF.Presentation.Extensions.Composition.Container attached property to a given DependencyObject.

Declaration
public static void SetContainer(this DependencyObject element, CompositionContainer value)
Parameters
Type Name Description
DependencyObject element

The element on which to set the attached property.

CompositionContainer value

The property value to set.

View Source

XamlClone<T>(T)

Creates a xaml clone of the wpf element.

Declaration
public static T XamlClone<T>(this T original) where T : DependencyObject
Parameters
Type Name Description
T original

The wpf element to clone.

Returns
Type Description
T

The clone.

Type Parameters
Name Description
T

The wpf element type.

  • View Source
Back to top Generated by DocFX