Assembly: PresentationCore (in presentationcore.dll)
XML Namespace: http://schemas.microsoft.com/winfx/2006/xaml/presentation
All applications for Windows share the system Clipboard, so the contents are subject to change when you switch to another application.
For a list of predefined formats available to use with the Clipboard class, see the DataFormats class.
Security Alert: For security purposes, the following points should be kept in mind.
Paste operations need to be user initiated (Ctl-V, Paste Menu).
Copy can only be on user selected content.
On copy or cut, partial trust code puts plaintext and Extensible Application Markup Language (XAML) on to the clipboard. Plaintext includes text, Unicode text, OEM (Object Exchange Model) text, and CSV (Comma-separated values).
On paste, Windows Presentation Foundation (WPF) will paste in Extensible Application Markup Language (XAML) if the source of that content is from a equally trusted or more trusted site. Specifically:
A partial trust application can paste Extensible Application Markup Language (XAML) from a full trust application.
A partial trust application can paste Extensible Application Markup Language (XAML) from a partial trust application.
A full trust application can paste XAML only from another fully trusted application.
A non-Windows Presentation Foundation (WPF) full trust application can examine the ApplicationTrust format on the clipboard and sanitize the XAML if appropriate.
The following example shows how to add data to the system Clipboard.
// For this example, the data to be placed on the clipboard is a simple // string. string textData = "I want to put this string on the clipboard."; // After this call, the data (string) is placed on the clipboard and tagged // with a data format of "Text". Clipboard.SetData(DataFormats.Text, (Object)textData);
For a more complete Clipboard sample, see Clipboard Spy Sample.
Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter EditionThe Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.