Skip to main content

TranslatePoint Method

Translates a point relative to this visual to coordinates that are relative to the specified visual.

Definition

Namespace: Avalonia
Assembly: Avalonia.Base (in Avalonia.Base.dll)

public static Point? TranslatePoint(
this Visual visual,
Point point,
Visual relativeTo
)

Parameters

  Visual
The visual.
  Point
The point value, as relative to this visual.
  Visual
The visual to translate the given point into.

Return Value

Nullable(Point)
A point value, now relative to the target visual rather than this source element, or null if the two elements have no common ancestor.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Visual. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

See Also

Reference

VisualExtensions Class
Avalonia Namespace