Matt126
Matt126

Reputation: 997

Using clipboard on Uno Platform

I am trying to get content from the clipboard on Android with:

DataPackageView dataPackageView = Clipboard.GetContent();

The namespace and the method exists both on uwp and android. But in the latter, there is an not implemented exception, when running the code.

To my knowledge, the clipboard should be implemented in uno platform. Am I doing something wrong?

Upvotes: 2

Views: 213

Answers (1)

Jérôme Laban
Jérôme Laban

Reputation: 5282

Clipboard.GetContent is implemented in Uno 3.0 (still in development as of 2020/07/26), and you can use it as follows:

private async void Paste()
{
   var content = Clipboard.GetContent();
   Text = await content.GetTextAsync();
}

Upvotes: 4

Related Questions