Provides static methods that facilitate transferring data to and from the system clipboard. In Silverlight 5, this access is limited to Unicode text strings.
Assembly: System.Windows (in System.Windows.dll)
Thetype exposes the following members.
In Silverlight 5, access to clipboard information is limited to Unicode text access. This differs from the WPF implementation of Clipboard, which enables access to other specific types (for example, streams or images) or to data objects.
In partial trust (the default mode for browser-hosted Silverlight-based applications), Silverlight also restricts clipboard access to its two key APIs GetText and SetText. These APIs can only be invoked from within a context that is determined by the Silverlight runtime to be in response to a user-initiated action. For example, clipboard access is valid from within a handler for a Click or KeyDown event. In contrast, clipboard access is not valid from a handler for Loaded or from a constructor, and access attempts throw exceptions.
In addition, Silverlight prompts the user for confirmation if the clipboard is accessed under partial trust. This Silverlight access-confirmation dialog box is displayed one time per session. If you specifically produce an out-of-browser application and request elevated trust, this security restriction on the API and its dialog box are not used. For more information, see Trusted Applications.
Certain controls (for example, TextBox and RichTextBox) also support a form of clipboard access. In these cases, the control provides class-based event handling for certain input events (for example, KeyDown). The control provides the infrastructure for integrating with the system clipboard without requiring a control's consumer to specifically handle input events or call API. For example, the key handling of Ctrl+C might copy any selected plaintext from the control to the system clipboard, and Ctrl+V might paste plaintext to a focused region of a control that can present text content. These controls both populate and use the clipboard. This type of behavior is specific to each control, and you should read the class documentation topics for these controls to obtain more information.
In order to be useful for a clipboard Cut or Copy scenario, a Silverlight UI element must support a concept of selection of regions that might contain text. In order to be useful for a clipboard Paste scenario, a Silverlight UI element must be able to present text. Typically, such a UI element should support a text insertion point.
Silverlight 5 supports a related drag-and-drop scenario in which a UIElement can be a drop target for a data payload that communicates a file list. However, this scenario does not directly involve the class, and uses specific event data and the DataObject class. For more information, see AllowDrop.
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.