Try to cast the current instance to the given type. The cast is dynamically tested for safety.

C# | Visual Basic | Visual C++ |
T CastAs<T>() where T : class, IManagedWrapper
Function CastAs(Of T As {Class, IManagedWrapper}) As T
generic<typename T> where T : ref class, IManagedWrapper T CastAs()

- T
- The type of the instance.

The cast instance or null if the cast is not valid

- Available in Monobjc Bridge: 10.6 (For Mac OS X 10.6 and later), 10.5 (For Mac OS X 10.5 and later)