IsAlive Property
Collapse the table of content
Expand the table of content

WeakReference.IsAlive Property

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

Gets an indication whether the object referenced by the current WeakReference object has been garbage collected.

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

public virtual bool IsAlive { get; }

Property Value

Type: System.Boolean
true if the object referenced by the current WeakReference object has not been garbage collected and is still accessible; otherwise, false.

Because an object could potentially be reclaimed for garbage collection immediately after the IsAlive property returns true, using this property is not recommended unless you are testing only for a false return value.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft