I want to share data in the Clipboard (for example Images) through the share charm. Is it possible to use the windows clipboard content in the Windows 8.1 Share Charm? Unfortunately the DataTransferManager isn't available in desktop apps, so how am I able to share the clipboard with the charms-bar?
You can’t copy to the clipboard via the share charm, but you can certainly build the functionality into your app. To copy an image to the clipboard you could do something like this:
void OnCopyAppBarButtonClick(object sender, RoutedEventArgs args)
{
Windows.ApplicationModel.DataTransfer.DataPackage dataPackage = new DataPackage
{
RequestedOperation = DataPackageOperation.Move
};
dataPackage.SetBitmap(bitmapStream);
Windows.ApplicationModel.DataTransfer.Clipboard.SetContent(dataPackage);
}
Note that you'll need to convert your image to a RandomAccessStreamReference.
The DataPackage class also contains other methods to copy other data types - checkout the documentation here: https://msdn.microsoft.com/en-us/library/windows/apps/windows.applicationmodel.datatransfer.datapackage.aspx