.NET Framework (current version)
Initializes a new instance of the
WeakReference class, referencing the specified object and using the specified resurrection tracking. Namespace:
mscorlib (in mscorlib.dll)
An object to track.
Indicates when to stop tracking the object. If
true, the object is tracked after finalization; if false, the object is only tracked until finalization.
trackResurrection is false, a short weak reference is created. If trackResurrection is true, a long weak reference is created.
The following example creates a cache of data objects with short weak references. This example is part of a larger example provided for the
No code example is currently available or this language may not be supported.
Universal Windows Platform
Available since 8
Available since 1.1
Portable Class Library
portable .NET platforms Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Available since 8.1
Return to top