The Clipboard class lets you copy and paste text to the system clipboard between applications.
To start using this API, read the getting started guide for Xamarin.Essentials to ensure the library is properly installed and set up in your projects.
Add a reference to Xamarin.Essentials in your class:
To check if the Clipboard has text currently ready to be pasted:
var hasText = Clipboard.HasText;
To set text to the Clipboard:
await Clipboard.SetTextAsync("Hello World");
To read text from the Clipboard:
var text = await Clipboard.GetTextAsync();
We'd love to hear your thoughts. Choose the type you'd like to provide:
Our feedback system is built on GitHub Issues. Read more on our blog.