WeakReference Constructor (Object, Boolean)
Collapse the table of content
Expand the table of content

WeakReference Constructor (Object, Boolean)

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

Initializes a new instance of the WeakReference class, referencing the specified object and using the specified resurrection tracking.

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

'Declaration
Public Sub New ( _
	target As Object, _
	trackResurrection As Boolean _
)

Parameters

target
Type: System.Object
An object to track.
trackResurrection
Type: System.Boolean
Indicates when to stop tracking the object. If true, the object is tracked after finalization; if false, the object is only tracked until finalization.

If trackResurrection is false, a short weak reference is created. If trackResurrection is true, a long weak reference is created.

Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows CE Platform Note: Short weak references are supported on the .NET Compact Framework, but long weak references are not supported. When you use this method, you must set the trackResurrection parameter to false.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft