Search Results for

    Show / Hide Table of Contents

    Class HelperExtensions

    Collection of extension methods e.g. visual tree traversal

    Inheritance
    Object
    HelperExtensions
    Inherited Members
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    Object.ToString()
    Namespace: BionicCode.Utilities.Net
    Assembly: BionicCode.Utilities.Net.Wpf.dll
    Syntax
    public static class HelperExtensions

    Methods

    | Improve this Doc View Source

    CloneElement(UIElement)

    Deep clones a UIElement.

    Declaration
    public static UIElement CloneElement(this UIElement elementToClone)
    Parameters
    Type Name Description
    UIElement elementToClone
    Returns
    Type Description
    UIElement

    A clone of the elementToClone instance.

    Remarks

    This member uses serialization to produce a clone of the UIElement instance.

    | Improve this Doc View Source

    EnumerateVisualChildElements<TChildren>(DependencyObject)

    Traverses the visual tree towards the leafs until all elements with a matching element type is found. Returns an IEnumerable<T> to enable deferred traversal.

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

    The current extended DependencyObject.

    Returns
    Type Description
    IEnumerable<TChildren>

    An enumerable collection of matching visual child elements.

    Type Parameters
    Name Description
    TChildren

    The type the visual children must match.

    | Improve this Doc View Source

    GetExtremePoints(IEnumerable<Point>)

    Declaration
    public static (Point MaxX, Point MinX, Point MaxY, Point MinY) GetExtremePoints(this IEnumerable<Point> points)
    Parameters
    Type Name Description
    IEnumerable<Point> points
    Returns
    Type Description
    System.ValueTuple<Point, Point, Point, Point>
    | Improve this Doc View Source

    ToCartesianPoint(Point, Double)

    Declaration
    public static Point ToCartesianPoint(this Point cartesianPoint, double height)
    Parameters
    Type Name Description
    Point cartesianPoint
    Double height
    Returns
    Type Description
    Point
    | Improve this Doc View Source

    ToDegrees(Double)

    Declaration
    public static double ToDegrees(this double angleRadians)
    Parameters
    Type Name Description
    Double angleRadians
    Returns
    Type Description
    Double
    | Improve this Doc View Source

    ToRadians(Double)

    Declaration
    public static double ToRadians(this double angleDegrees)
    Parameters
    Type Name Description
    Double angleDegrees
    Returns
    Type Description
    Double
    | Improve this Doc View Source

    ToScreenPoint(Point, Double)

    Declaration
    public static Point ToScreenPoint(this Point cartesianPoint, double yAxisPositiveLimit)
    Parameters
    Type Name Description
    Point cartesianPoint
    Double yAxisPositiveLimit
    Returns
    Type Description
    Point
    | Improve this Doc View Source

    TryAssignValue(FrameworkElement, Object)

    Tries to add a value to the visual tree of an unknown FrameworkElement. For example if the element is a TextBlock the value is assigned to the Text property.

    Declaration
    public static bool TryAssignValue(this FrameworkElement frameworkElement, object value)
    Parameters
    Type Name Description
    FrameworkElement frameworkElement
    Object value
    Returns
    Type Description
    Boolean

    true if the assignment was succesful. Otherwise false.

    | Improve this Doc View Source

    TryFindVisualChildElement<TChild>(DependencyObject, out TChild)

    Traverses the visual tree towards the leafs until an element with a matching element type is found.

    Declaration
    public static bool TryFindVisualChildElement<TChild>(this DependencyObject parent, out TChild resultElement)
        where TChild : DependencyObject
    Parameters
    Type Name Description
    DependencyObject parent
    TChild resultElement
    Returns
    Type Description
    Boolean
    Type Parameters
    Name Description
    TChild

    The type the visual child must match.

    | Improve this Doc View Source

    TryFindVisualChildElementByName<TChild>(DependencyObject, String, out TChild)

    Traverses the visual tree towards the leafs until an element with a matching element name is found.

    Declaration
    public static bool TryFindVisualChildElementByName<TChild>(this DependencyObject parent, string childElementName, out TChild resultElement)
        where TChild : FrameworkElement
    Parameters
    Type Name Description
    DependencyObject parent
    String childElementName

    The name the visual child's name must match.

    TChild resultElement

    The found element or null if no matching element was found.

    Returns
    Type Description
    Boolean

    true when an element with the specified childElementName was found, otherwise false.

    Type Parameters
    Name Description
    TChild
    | Improve this Doc View Source

    TryFindVisualParentElement<TParent>(DependencyObject, out TParent)

    Traverses the visual tree towards the root until an element with a matching element name is found.

    Declaration
    public static bool TryFindVisualParentElement<TParent>(this DependencyObject child, out TParent resultElement)
        where TParent : DependencyObject
    Parameters
    Type Name Description
    DependencyObject child
    TParent resultElement
    Returns
    Type Description
    Boolean
    Type Parameters
    Name Description
    TParent

    The type the visual parent must match.

    | Improve this Doc View Source

    TryFindVisualParentElementByName<TChild>(DependencyObject, String, out TChild)

    Traverses the visual tree towards the root until an element with a matching element type is found.

    Declaration
    public static bool TryFindVisualParentElementByName<TChild>(this DependencyObject child, string elementName, out TChild resultElement)
        where TChild : FrameworkElement
    Parameters
    Type Name Description
    DependencyObject child
    String elementName

    The element name the visual parent must match.

    TChild resultElement
    Returns
    Type Description
    Boolean
    Type Parameters
    Name Description
    TChild
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX