There will be a few cases where you need to manually cast an object to some type, because while you are sure that the object is of the appropriate type, the compiler is not.

To manually cast, use as (e.g., object as SomeClass) to get a reference cast as the requested type.

You can learn more about this in:
Run Edit