TypeUtilitiesTryConvert Method

Try to convert a value to a type by any means possible.

Definition

Namespace: Avalonia.Utilities
Assembly: Avalonia.Base (in Avalonia.Base.dll) Version: 11.3.999
public static bool TryConvert(
	Type to,
	Object? value,
	CultureInfo? culture,
	out Object?? result
)

Parameters

to  Type
The type to convert to.
value  Object
The value to convert.
culture  CultureInfo
The culture to use.
result  Object
If successful, contains the convert value.

Return Value

Boolean
True if the cast was successful, otherwise false.

See Also