How to add text to Clipboard in Windows Phone Runtime?

淺唱寂寞╮ 提交于 2019-12-05 18:39:40

问题


previously in Windows Phone 8 we could use Clipboard to share text. It's supported in Windows 8,

Clipboard.SetContent(dataPackage);

But I see it is not supported for Windows Phone Runtime. Is it not possible anymore or there is another way to do that?


回答1:


You pretty much answered your own question. Clipboard APIs are currently available only on Windows Phone Silverlight 8.0 and 8.1, and not on Windows Phone WinRT.

More info: Windows Phone 8.1 for Developers - Choose your Windows Phone XAML app model

EDIT: Migrating your Windows Phone 8 app to a Windows Runtime XAML app states that Clipboard is a "Windows Phone 8 feature for which there is no Windows Phone Store equivalent"




回答2:


there is a way to do so now using WinRT framework syntax. Using the lib Charming Share Just import Clipboard class from this lib. I've tested it - works but leaves app for a while. I am presuming that this is a call to the lib written using Silverlight 8.1 Cheers!



来源:https://stackoverflow.com/questions/24264147/how-to-add-text-to-clipboard-in-windows-phone-runtime

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!