TypeUtilities.

TryConvert(Type, object, CultureInfo, object) Method

Summary

Try to convert a value to a type by any means possible.
Namespace
Avalonia.Utilities
Containing Type
TypeUtilities

Syntax

public static bool TryConvert(Type to, object value, CultureInfo culture, out object result)

Parameters

Name Type Description
to Type The type to cast to.
value object The value to cast.
culture CultureInfo The culture to use.
result object If successful, contains the cast value.

Return Value

Type Description
bool True if the cast was successful, otherwise false.