DependentHandle.Dependent Property

Definition

Gets or sets the dependent object instance for the current handle.

C#
public object? Dependent { get; set; }

Property Value

Exceptions

Remarks

If you need to retrieve both Target and Dependent, ensure that the returned instance from Target will be kept alive until Dependent is retrieved as well, or it might be collected and result in unexpected behavior. This can be done by storing the target in a local and calling KeepAlive(Object) on it after Dependent is accessed.

Applies to

Product Versions
.NET 6, 7, 8, 9