Skip to main content

Cast<T> Method

Casts the type of an Optional(T) using only the C# cast operator.

Definition

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

public static Optional<T> Cast<T>(
this Optional<Object> value
)

Parameters

  Optional(Object)
The binding value.

Type Parameters

The target type.

Return Value

Optional(T)
The cast value.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Optional(Object). When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

See Also

Reference

OptionalExtensions Class
Avalonia.Data Namespace