Wp7 Mango Clipboard access / upgrade project from 7.0 to 7.1
The docs http://msdn.microsoft.com/en-us/library/ms597043%28v=VS.96%29.aspx state the System.Windows.Clipboard should be available in Windows Phone 7.1. I tried using it in the Visual Studio Express 2010 (beta 2 for Mango from June) but when
using System.Windows.Clipboard;
VS complains :
Error 1 The type or namespace name 'Clipboard' does not exist in the namespace 'System.Windows' (are you missing an assembly reference?)
Do I miss anything or is this just not ready yet?
UPDATE: Seems to work if I start a new project targetting Windows Phone 7.1 from the beginning. I just don't know how to c开发者_C百科hange the setting from 7.0 to 7.1...
Thanks a lot! Chris
Clipboard
is a class and not a namespace. Therefore, you cannot declare it in the class header like you're doing it. Simply add a using System.Windows;
and use Clipboard.<method>
inside the application.
As it was stated in the comments, the problem lies in the fact that a project build for NoDo is used with Mango dev tools. The project was not automatically updated and still relies on WP OS 7.0. To upgrade it, right click on the project in Solution Explorer and click on Upgrade to Windows Phone 7.1.
精彩评论