Version

GetWeakReferenceTargetSafe Method

Wraps the 'get' of the Target property in a try/catch to prevent unhandled exceptions
Syntax
public static object GetWeakReferenceTargetSafe( 
   WeakReference weakReference
)

Parameters

weakReference
The WeakRefernce holding the target.

Return Value

The Target or null if an exception was thrown.
Requirements

Target Platforms: Android 4.4+, iOS 8+

Development Environments: Visual Studio 2015+, Visual Studio for Mac Preview, Xamarin for Visual Studio 4.2+

See Also