Skip to main content

CanCast<T> Method

Returns a value indicating whether value can be casted to the specified type. If value is null, checks if instances of that type can be null.

Definition​

Namespace: Avalonia.Utilities
Assembly: Avalonia.Base (in Avalonia.Base.dll)

public static bool CanCast<T>(
Object? value
)

Parameters​

  Object
The value to check if cast possible

Type Parameters​

The type to cast to

Return Value​

Boolean
True if the cast is possible, otherwise false.

See Also​

Reference​

TypeUtilities Class
Avalonia.Utilities Namespace