Skip to main content

TransformToVisual Method

Returns a transform that transforms the visual's coordinates into the coordinates of the specified to.

Definition

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

public static Matrix? TransformToVisual(
this Visual from,
Visual to
)

Parameters

  Visual
The visual whose coordinates are to be transformed.
  Visual
The visual to translate the coordinates to.

Return Value

Nullable(Matrix)
A Matrix containing the transform or null if the visuals don't share a 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