Skip to main content

TryGetTextAsync Method

Returns a text, if available, from the clipboard.

Definition​

Namespace: Avalonia.Input.Platform
Assembly: Avalonia.Base (in Avalonia.Base.dll)

public static Task<string?> TryGetTextAsync(
this IClipboard clipboard
)

Parameters​

  IClipboard
The clipboard instance.

Return Value​

Task(String)
A string, or null if the format isn't available.

Usage Note​

In Visual Basic and C#, you can call this method as an instance method on any object of type IClipboard. 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​

ClipboardExtensions Class
Avalonia.Input.Platform Namespace
Text