Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can the new WP7 cut and paste functionality be used programmatically?

As the new (January 2011) Update to the Windows Phone Developer Tools adds support for Cut and Paste, can this be used programmatically in code?

like image 311
Matt Lacey Avatar asked Feb 05 '11 00:02

Matt Lacey


1 Answers

No.

The January 2011 update does not include programatic access to the clipboard (or any new APIs). The clipboard can only be accessed by the user to cut and paste text. Yes, only text can be cut, copied and pasted.

Cut and paste functionality has been added to all textboxes and textboxes within your application will automatically get this ability when run on the updated emulator or a device which has had the update applied. This applies even if you make the textbox readonly.

If you are using a textbox within a Pivot or Panorama (which the guidelines advise against) you should review your app with regard to any possible problems in this area. (Sliding with a finger to expand the selected area may cause the pivot or panorama to slide. You probably don't want this.)

Mango Update

Mango (v7.1) introduces programmatic access to the Clipboard but only for setting text, not getting any text which is already there.

From MSDN:

"You cannot get clipboard text from a Windows Phone application, only set it. Calling the GetText method in a Windows Phone application will always cause a SecurityException to occur."

like image 188
Matt Lacey Avatar answered Sep 27 '22 20:09

Matt Lacey