DependencyObjectExtensionsSafeTransformToVisual Method Document Toolkit Help
Safely returns a transform object. Returns null a transform object could not be created.

Namespace: FirstFloor.Documents
Assembly: FirstFloor.Documents (in FirstFloor.Documents.dll) Version: 2.5.0.0 (2.5.11.0)
Syntax

public static GeneralTransform SafeTransformToVisual(
	this UIElement element,
	UIElement visual
)

Parameters

element
Type: System.WindowsUIElement
The element.
visual
Type: System.WindowsUIElement
The visual.

Return Value

Type: GeneralTransform
The transform information as an object.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type UIElement. 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).
Remarks

This method avoids the dreaded ArgumentException when both elements are not in the same visual tree or the layout has not been updated yet.
See Also

Reference