Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Clipboard API in Windows Phone

DZone's Guide to

Clipboard API in Windows Phone

· Mobile Zone
Free Resource

Launching an app doesn’t need to be daunting. Whether you’re just getting started or need a refresher on mobile app testing best practices, this guide is your resource! Brought to you in partnership with Perfecto

In this post we will see Clipboard API support in Windows Phone. Clipboard API support came as part of Windows Phone 7.5 and it was not part of Windows Phone 7.

Class is defined in System.Windows namespace as below,

clip_image002

You can set text as below,

clip_image004

In above snippet txtSource is a text box. You can check whether clipboard has some data or not as below,

clip_image006

One very important point you need to keep in mind that you cannot use GetText() method in Windows Phone. If you try to do that you will get security exception as below,

clip_image007

For security reason access to clipboard data is prohibited in Windows Phone. In this way you can use Windows Phone Clipboard API. I hope this post is useful. Thanks for reading .

Keep up with the latest DevTest Jargon with the latest Mobile DevTest Dictionary. Brought to you in partnership with Perfecto.

Topics:

Published at DZone with permission of Dhananjay Kumar, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}