Clipboard Application Program The example demonstrates how to use commands such as copy, paste, cut, and move. This example uses the windows. ApplicationModel class. Datatransfer namespace. Some classes, you may want to discuss in detail the clipboard class, which accesses the clipboard, datapackage class, you can use it to pack content before joining to the clipboard. This example includes the following: • How to copy and paste text • how to copy and paste an image • how to copy and paste a file • How To Get A format on the clipboard • how to detect changes to the clipboard learn more about using the clipboard, we recommend that you take a look at our guidelines and checklists for clipboard commands and our Quick Start: clipboard basic theme async Void Scenario1pastebutton_click ( Object Sender, routedeventargs E)
{
Scenario1outputtext. Text = " Content in the clipboard: " ;
Datapackageview = clipboard. getcontent ();
If (Datapackageview. Contains (standarddataformats. Text ))
{
Scenario1outputtext. Text = " Text: " + Environment. newline + await datapackageview. gettextasync ();
}
Else
{
Scenario1outputtext. Text = " Text: " + Environment. newline + " No text format on clipboard " ;
}
If (Datapackageview. Contains (standarddataformats. html ))
{
String Htmlformat = await datapackageview. gethtmlformatasync ();
String Htmlfragment = htmlformathelper. getstaticfragment (htmlformat );
Scenario1outputhtml. navigatetostring ( " HTML: <br/> " + Htmlfragment );
}
Else
{
Scenario1outputhtml. navigatetostring ( " HTML: <br/> no html format on clipboard " );
}
}
Complete example:/files/risk/windows8/clipboard application sample.rar