WeakGCHandle<T>.TryGetTarget(T) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Tries to retrieve the target object that is referenced by the current WeakGCHandle<T> object.
public:
bool TryGetTarget([Runtime::InteropServices::Out] T % target);
public readonly bool TryGetTarget(out T? target);
member this.TryGetTarget : 'T -> bool
Public Function TryGetTarget (ByRef target As T) As Boolean
Parameters
- target
- T
When this method returns, contains the target object, if it is available.
Returns
true if the target was retrieved; otherwise, false.
Exceptions
The handle is not initialized or is already disposed.