可以以编程方式使用新的WP7剪切和粘贴功能吗? [英] Can the new WP7 cut and paste functionality be used programmatically?

查看:54
本文介绍了可以以编程方式使用新的WP7剪切和粘贴功能吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

随着Windows Phone开发人员工具的新更新(2011年1月)增加了对剪切和粘贴的支持,可以在代码中以编程方式使用它吗?

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?

推荐答案

否。

2011年1月的更新不包括对剪贴板(或任何新API)的编程访问。剪贴板只能由用户访问以剪切和粘贴文本。是的,只能剪切,复制和粘贴文本。

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

芒果更新

芒果(v7.1)引入了对剪贴板,但仅用于设置文本,不会获取已经存在的任何文本。

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

来自 MSDN


您不能从Windows Phone应用程序中获取剪贴板文本,只有
设置它。在Windows Phone应用程序中调用GetText方法将始终导致
发生SecurityException。

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

这篇关于可以以编程方式使用新的WP7剪切和粘贴功能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆