How to add text to Clipboard in Windows Phone Runtime?
Asked Answered
B

2

9

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?

Boniface answered 17/6, 2014 at 12:43 Comment(4)
What the hell is happening in StackOverFlow? Two questions asked and both got negative vote while voters don't even read question well! It's about Windows Phone Runtime not silverlight @SaverioTerracciano :\Boniface
@Boniface People usually downvote questions when a simple online search can give you an answer. For example, searching for "windows phone 8.1 winrt clipboard" gives this link as one of the first results: msdn.microsoft.com/en-us/library/dn642486%28v=vs.105%29.aspx. Article on that link says that Clipboard is a "Windows Phone 8 feature for which there is no Windows Phone Store equivalent"Hydrastis
@igrali , Thanks. I didn't know to search about clipboard in Migrating article.. There are still less information about new version thoughBoniface
@igrali what people would be expecting is some workaround method to achieve the functionality on stackoverflow. a simple search actually pointed me to this question.Wilde
H
10

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"

Hydrastis answered 17/6, 2014 at 12:51 Comment(1)
So literally there isn't any way to put something into clipboard in Windows Phone Runtime Apps?Inappropriate
A
0

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!

Advantage answered 3/12, 2015 at 11:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.