Class VisualElementExtensions
Xamarin.Forms.VisualElement extension methods
Inheritance
VisualElementExtensions
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
Returns
BoundsInWindowCoord(VisualElement)
Translates the bounds of an element to the coordinates of app's window
Declaration
public static Rectangle BoundsInWindowCoord(this VisualElement element)
Parameters
Returns
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
Returns
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
Returns
FindAncestorOfType(Element, Type)
returns first ancestor element of given type
Declaration
public static Element FindAncestorOfType(this Element element, Type type)
Parameters
Returns
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
Returns
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
Returns
Type Parameters
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
FindFocused()
Finds the currently focused VisualElement.
Declaration
public static VisualElement FindFocused()
Returns
FindVisualElementsOfType<T>()
Enumarates all VisualElements with a given type (T)
Declaration
public static List<T> FindVisualElementsOfType<T>()
where T : VisualElement
Returns
Type Parameters
FindVisualElementsOfType<T>(VisualElement)
Enumarates all the chilren of a VisualElement
Declaration
public static List<T> FindVisualElementsOfType<T>(this VisualElement parentElement)
where T : VisualElement
Parameters
Returns
Type Parameters
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
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 Parameters
GestureListener(VisualElement)
Gets or creates a FormsGestures.Listener for a Xamarin.Forms.VisualElement
Declaration
public static Listener GestureListener(this VisualElement element)
Parameters
Returns
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
Returns
IsAncestorOf(Element, Element)
Is this element an ancestor or a descendent element?
Declaration
public static bool IsAncestorOf(this Element ancestor, Element child)
Parameters
Returns
IsDescendentOf(Element, Element)
Is this element a descendent of an ancestor element?
Declaration
public static bool IsDescendentOf(this Element child, Element ancestor)
Parameters
Returns
IsInVisibleViewTree(VisualElement)
Is the element in the current visible view tree?
Declaration
public static bool IsInVisibleViewTree(this VisualElement visualElement)
Parameters
Returns
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
Returns
LocationInWindowCoord(VisualElement)
Translates the location of an element to the app's window's coordinates
Declaration
public static Point LocationInWindowCoord(this VisualElement element)
Parameters
Returns
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
Returns
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
Returns