Skip to main content

SetValuesAsync<T> Method

Places multiple values on the clipboard in the specified format.

Definition​

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

public static Task SetValuesAsync<T>(
this IClipboard clipboard,
DataFormat<T> format,
IEnumerable<T>? values
)
where T : class

Parameters​

  IClipboard
The clipboard instance.
  DataFormat(T)
The data format.
  IEnumerable(T)
The values to place on the clipboard.

Type Parameters​

Return Value​

Task

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).

Remarks​

By calling this method, the clipboard will get cleared of any possible previous data.

If values is null or empty, nothing will get placed on the clipboard and this method will be equivalent to ClearAsync().

See Also​

Reference​

ClipboardExtensions Class
Avalonia.Input.Platform Namespace