Clipboard
Namespace: XPlat.ApplicationModel.DataTransfer
Gets and sets information from the clipboard object.
Supported platforms
Platform
Version
Xamarin.Android
9.0
Xamarin.iOS
1.0
UWP
10.0.16299
Example
This example shows how to use the Clipboard class to add text to be pasted anywhere, and retrieve text from the Clipboard.
Static Methods
GetContent()
Gets the current content that is stored in the clipboard object.
Returns
Contains the content of the Clipboard.
GetTextAsync()
Gets the current text content that is stored in the clipboard object.
Returns
The text.
SetContent(DataPackage)
Sets the current content that is stored in the clipboard object.
Parameters
content (DataPackage)
Contains the content of the clipboard. If NULL, the clipboard is emptied.
SetText(string)
Sets the current text that is stored in the clipboard object.
Parameters
text (string)
The text.
Clear()
Removes all data from the Clipboard.
Static Events
ContentChanged
Occurs when the data stored in the Clipboard changes.
Related information
References
Last updated