WeakReference.Target Property
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Gets or sets the object (the target) referenced by the current WeakReference object.
Assembly: mscorlib (in mscorlib.dll)
Property Value
Type: System.ObjectNothing if the object referenced by the current WeakReference object has been garbage collected; otherwise, a reference to the object referenced by the current WeakReference object.
| Exception | Condition |
|---|---|
| InvalidOperationException | The reference to the target object is invalid. This exception can be thrown while setting this property if the value is a null reference or if the object has been finalized during the set operation. |
Show: