Class VisualTreeHelper
Implements visual tree cache and helper methods
Inheritance
System.Object
VisualTreeHelper
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: EmptyKeys.UserInterface.Media
Assembly: EmptyKeys.UserInterface.dll
Syntax
public sealed class VisualTreeHelper
Properties
Instance
Gets the instance.
Declaration
public static VisualTreeHelper Instance { get; }
Property Value
Type | Description |
---|---|
VisualTreeHelper | The instance. |
Methods
AddParentToCache(DependencyObject, DependencyObject)
Adds the parent to cache.
Declaration
public void AddParentToCache(DependencyObject parent, DependencyObject child)
Parameters
Type | Name | Description |
---|---|---|
DependencyObject | parent | The parent. |
DependencyObject | child | The child. |
ClearParentCache()
Clears the parent cache.
Declaration
public void ClearParentCache()
FindElementByName(UIElement, String)
Finds the element
Declaration
public UIElement FindElementByName(UIElement parent, string name)
Parameters
Type | Name | Description |
---|---|---|
UIElement | parent | The parent. |
System.String | name | The name. |
Returns
Type | Description |
---|---|
UIElement |
GetAllParents()
Gets all parents.
Declaration
public ICollection<DependencyObject> GetAllParents()
Returns
Type | Description |
---|---|
System.Collections.Generic.ICollection<DependencyObject> |
GetChildren(DependencyObject)
Gets the children.
Declaration
public List<DependencyObject> GetChildren(DependencyObject parent)
Parameters
Type | Name | Description |
---|---|---|
DependencyObject | parent | The parent. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<DependencyObject> |
GetRoot()
Gets the root.
Declaration
public UIRoot GetRoot()
Returns
Type | Description |
---|---|
UIRoot |
InvalidateMeasure(UIElement)
Invalidates the measure of parent and all children in visual tree.
Declaration
public void InvalidateMeasure(UIElement parent)
Parameters
Type | Name | Description |
---|---|---|
UIElement | parent | The parent. |
RemoveChild(DependencyObject, DependencyObject)
Removes the child.
Declaration
public void RemoveChild(DependencyObject child, DependencyObject oldParent)
Parameters
Type | Name | Description |
---|---|---|
DependencyObject | child | The child. |
DependencyObject | oldParent | The old parent. |