TryConvert Method
Try to convert a value to a type by any means possible.
Definition
Namespace: Avalonia.Utilities
Assembly: Avalonia.Base (in Avalonia.Base.dll)
- C#
- VB
- F#
public static bool TryConvert(
Type to,
Object? value,
CultureInfo? culture,
out Object?? result
)
Public Shared Function TryConvert (
to As Type,
value As Object,
culture As CultureInfo,
<OutAttribute> ByRef result As Object
) As Boolean
static member TryConvert :
to : Type *
value : Object *
culture : CultureInfo *
result : Object byref -> bool
Parameters
- Type
- The type to convert to.
- Object
- The value to convert.
- CultureInfo
- The culture to use.
- Object
- If successful, contains the convert value.
Return Value
Boolean
True if the cast was successful, otherwise false.