SetValueAsync<T> Method
Places a single value on the clipboard in the specified format.
Definition
Namespace: Avalonia.Input.Platform
Assembly: Avalonia.Base (in Avalonia.Base.dll)
- C#
- VB
- F#
public static Task SetValueAsync<T>(
this IClipboard clipboard,
DataFormat<T> format,
T value
)
where T : class
<ExtensionAttribute>
Public Shared Function SetValueAsync(Of T As Class) (
clipboard As IClipboard,
format As DataFormat(Of T),
value As T
) As Task
[<ExtensionAttribute>]
static member SetValueAsync :
clipboard : IClipboard *
format : DataFormat<'T> *
value : 'T -> Task when 'T : not struct
Parameters
- IClipboard
- The clipboard instance.
- DataFormat(T)
- The data format.
- T
- The value to place on the clipboard.
Type Parameters
Return Value
TaskUsage 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 value is null, nothing will get placed on the clipboard and this method will be equivalent to ClearAsync().