WeakReference<(Of <(T>)>).TryGetTarget Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Tries to retrieve the target object that is referenced by the current WeakReference<(Of <(T>)>) object.

Namespace: System
Assembly: mscorlib (in mscorlib.dll)


Public Function TryGetTarget ( _
    <OutAttribute> ByRef target As T _
) As Boolean
public bool TryGetTarget(
    out T target


  • target
    Type: T%
    When this method returns, contains the target object, if available. This parameter is passed uninitialized.

Return Value

Type: System..::.Boolean
true if the target was retrieved, false otherwise.

Version Information

Windows Phone OS

Supported in: 8.1, 8.0

See Also


WeakReference<(Of <(T>)>) Class

System Namespace