简体   繁体   中英

Windows Phone 8.1 Copy Text to Clipboard

I'm building a Windows Phone 8.1 XAML/C# app. I am not quite sure how to copy some text to clipboard. The Clipboard API is not supported. Anyone faced such scenario? If yes, would you please share the idea? This is one the most requested feature for my app. Please help.

I tried with DataPackage code and also Clipboard code just for an attempt. Both didn't work. I am aware of the Silverlight platform support for Clipboard APIs. But I believe there should be a workaround. Otherwise, I will need to port the whole app to SL just for this feature.

As you mentioned that you have tried DataPackage and Clipboard code but didn't worked. Can you again give a try to same code by looking at below link which provide basic info about DataPackage and CLipboard.

DataPackage & Clipboard in XAML

Edit:

There is no support for clipboard in 8.1. You have to use Silverlight but you don't want to.

Try This,,,

http://peterfoot.net/2014/04/30/clipboard-api-for-windows-phone-8-1/

This may be helpful.

Charming Share API 8.2014.4.301

Adds ready-made Share and Clipboard functionality to Windows Phone. Share more code across platforms. Build Charming apps for Windows Phone!

Go to Package Manager Console and Install this Library

PM> Install-Package InTheHand.ApplicationModel.DataTransfer -Version 8.2014.4.301

I talked with dev support and it ended up with a conclusion that clipboard API is available only for Silverlight apps, not for RT apps. So I removed this from my proposed feature set and completely relying on SHARE data to third party apps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM