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

我的梦境 提交于 2019-11-30 23:53:32

问题


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?


回答1:


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."



来源:https://stackoverflow.com/questions/4904304/can-the-new-wp7-cut-and-paste-functionality-be-used-programmatically

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