Show / Hide Table of Contents

    Class VisualElementExtensions

    Xamarin.Forms.VisualElement extension methods

    Inheritance
    Object
    VisualElementExtensions
    Inherited Members
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    Object.ToString()
    Namespace: FormsGestures
    Assembly: FormsGestures.dll
    Syntax
    public static class VisualElementExtensions

    Methods

    BoundsInElementCoord(VisualElement, VisualElement)

    Translates the bounds of an element to the coordinates of another, reference element

    Declaration
    public static Rectangle BoundsInElementCoord(this VisualElement fromElement, VisualElement toElement)
    Parameters
    Type Name Description
    VisualElement fromElement
    VisualElement toElement
    Returns
    Type Description
    Rectangle

    BoundsInWindowCoord(VisualElement)

    Translates the bounds of an element to the coordinates of app's window

    Declaration
    public static Rectangle BoundsInWindowCoord(this VisualElement element)
    Parameters
    Type Name Description
    VisualElement element
    Returns
    Type Description
    Rectangle

    CoordTransform(VisualElement, Point, VisualElement)

    translates a point from the coordinates of this element to that of another

    Declaration
    public static Point CoordTransform(VisualElement fromElement, Point p, VisualElement toElement)
    Parameters
    Type Name Description
    VisualElement fromElement
    Point p
    VisualElement toElement
    Returns
    Type Description
    Point

    CoordTransform(VisualElement, Rectangle, VisualElement)

    translates a rectangle from the coordinates of this element to that of another

    Declaration
    public static Rectangle CoordTransform(VisualElement fromElement, Rectangle r, VisualElement toElement)
    Parameters
    Type Name Description
    VisualElement fromElement
    Rectangle r
    VisualElement toElement
    Returns
    Type Description
    Rectangle

    FindAncestorOfType(Element, Type)

    returns first ancestor element of given type

    Declaration
    public static Element FindAncestorOfType(this Element element, Type type)
    Parameters
    Type Name Description
    Element element
    Type type
    Returns
    Type Description
    Element

    FindChildrenWithProperty(VisualElement, String)

    Enumarates all the chilren of a VisualElement with a given property name

    Declaration
    public static List<VisualElement> FindChildrenWithProperty(this VisualElement parentElement, string propertyName)
    Parameters
    Type Name Description
    VisualElement parentElement
    String propertyName
    Returns
    Type Description
    List<VisualElement>

    FindChildrenWithPropertyAndOfType<T>(VisualElement, String, List<T>)

    Enumerates all of the children of a parent element of a given type T

    Declaration
    public static List<T> FindChildrenWithPropertyAndOfType<T>(this VisualElement parentElement, string propertyName, List<T> result = null)
        where T : VisualElement
    Parameters
    Type Name Description
    VisualElement parentElement
    String propertyName
    List<T> result
    Returns
    Type Description
    List<T>
    Type Parameters
    Name Description
    T

    FindChildWithFocus(Element)

    Finds the child VisualElement that is currently focused.

    Declaration
    public static VisualElement FindChildWithFocus(this Element element)
    Parameters
    Type Name Description
    Element element

    Element.

    Returns
    Type Description
    VisualElement

    The child with focus.

    FindFocused()

    Finds the currently focused VisualElement.

    Declaration
    public static VisualElement FindFocused()
    Returns
    Type Description
    VisualElement

    The focused.

    FindVisualElementsOfType<T>()

    Enumarates all VisualElements with a given type (T)

    Declaration
    public static List<T> FindVisualElementsOfType<T>()
        where T : VisualElement
    Returns
    Type Description
    List<T>
    Type Parameters
    Name Description
    T

    FindVisualElementsOfType<T>(VisualElement)

    Enumarates all the chilren of a VisualElement

    Declaration
    public static List<T> FindVisualElementsOfType<T>(this VisualElement parentElement)
        where T : VisualElement
    Parameters
    Type Name Description
    VisualElement parentElement
    Returns
    Type Description
    List<T>
    Type Parameters
    Name Description
    T

    FindVisualElementsWithProperty(String)

    Enumarates all VisualElements with a given property name

    Declaration
    public static List<VisualElement> FindVisualElementsWithProperty(string propertyName)
    Parameters
    Type Name Description
    String propertyName
    Returns
    Type Description
    List<VisualElement>

    FindVisualElementsWithPropertyAndOfType<T>(String)

    Enumarates all VisualElements with a given type (T) and property name

    Declaration
    public static List<T> FindVisualElementsWithPropertyAndOfType<T>(string propertyName)
        where T : VisualElement
    Parameters
    Type Name Description
    String propertyName
    Returns
    Type Description
    List<T>
    Type Parameters
    Name Description
    T

    GestureListener(VisualElement)

    Gets or creates a FormsGestures.Listener for a Xamarin.Forms.VisualElement

    Declaration
    public static Listener GestureListener(this VisualElement element)
    Parameters
    Type Name Description
    VisualElement element
    Returns
    Type Description
    Listener

    HitTest(VisualElement, Point, VisualElement)

    determines if point in this element is withing the bounds of another, test element

    Declaration
    public static bool HitTest(this VisualElement hitElement, Point hitPoint, VisualElement targetElement)
    Parameters
    Type Name Description
    VisualElement hitElement
    Point hitPoint
    VisualElement targetElement
    Returns
    Type Description
    Boolean

    IsAncestorOf(Element, Element)

    Is this element an ancestor or a descendent element?

    Declaration
    public static bool IsAncestorOf(this Element ancestor, Element child)
    Parameters
    Type Name Description
    Element ancestor
    Element child
    Returns
    Type Description
    Boolean

    IsDescendentOf(Element, Element)

    Is this element a descendent of an ancestor element?

    Declaration
    public static bool IsDescendentOf(this Element child, Element ancestor)
    Parameters
    Type Name Description
    Element child
    Element ancestor
    Returns
    Type Description
    Boolean

    IsInVisibleViewTree(VisualElement)

    Is the element in the current visible view tree?

    Declaration
    public static bool IsInVisibleViewTree(this VisualElement visualElement)
    Parameters
    Type Name Description
    VisualElement visualElement
    Returns
    Type Description
    Boolean

    LocationInElementCoord(VisualElement, VisualElement)

    Translates the location of an element to the coordinates of another, reference element

    Declaration
    public static Point LocationInElementCoord(this VisualElement fromElement, VisualElement toElement)
    Parameters
    Type Name Description
    VisualElement fromElement
    VisualElement toElement
    Returns
    Type Description
    Point

    LocationInWindowCoord(VisualElement)

    Translates the location of an element to the app's window's coordinates

    Declaration
    public static Point LocationInWindowCoord(this VisualElement element)
    Parameters
    Type Name Description
    VisualElement element
    Returns
    Type Description
    Point

    PointInElementCoord(VisualElement, Point, VisualElement)

    Translates a point from its local view coordinates to that of another view

    Declaration
    public static Point PointInElementCoord(this VisualElement fromElement, Point p, VisualElement toElement)
    Parameters
    Type Name Description
    VisualElement fromElement
    Point p
    VisualElement toElement
    Returns
    Type Description
    Point

    PointInWindowCoord(VisualElement, Point)

    Returns a point (in a view) to the DIP Screen coordinates

    Declaration
    public static Point PointInWindowCoord(this VisualElement element, Point p)
    Parameters
    Type Name Description
    VisualElement element
    Point p
    Returns
    Type Description
    Point
    Back to top Copyright © 2018 42nd Parallel