问题
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