The static System.Windows.Clipboard
class allows you to place text on the systemwide clipboard, or to detect whether any text exists on the clipboard.
Note
You cannot retrieve the clipboard text from a Windows Phone app, only set it. Calling the GetText
method raises a SecurityException
.
Clipboard
contains the following three methods:
ContainsText()—Queries the clipboard for the presence of text. Returns true if text is present; otherwise, false.
SetText(string text)—Places text in the clipboard.
GetText()—Raises a SecurityException
on the Windows Phone platform.
Placing a Unicode string on the clipboard can be performed as shown:
Clipboard.SetText("foo");
The following example shows how to detect whether text is present on the clipboard:
bool clipBoardHasText = Clipboard.ContainsText();
If the ContainsText
method returns true it indicates that the clipboard button will be visible when the SIP is displayed (see Figure 6.12).
3.17.174.0