Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to programmatically copy/paste in windows phone? [duplicate]

Possible Duplicate:
Can the new WP7 cut and paste functionality be used programatically?

Is there a way to programmatically copy/paste text in windows phone. I want the user to click on a button that should automatically copy some text to the clipboard. The text resides on a TextBlock control (which may be hidden). The only workaround that I have thought of is to pop a dialog with the text filled in in a TextBlock (which natively supports copy paste).

Thoughts?

like image 691
hlgphone Avatar asked Apr 23 '11 02:04

hlgphone


1 Answers

To set text : Clipboard.SetText("foo-bar")

To check if clipboard contains text : Clipboard.ContainsText("foo-bar")

No method to to get text Clipboard.GetText() results in Security Exception

like image 129
Gaurav Shah Avatar answered Nov 15 '22 01:11

Gaurav Shah