Search code examples
c#windows-store-appssharing

Windows Store App 8.1 - share multiple DataPackages


I will share Data from my app in multiple formats. One Format is a csv-file (working) the other are text and html.

No problem with doing it in one DataPackage. But if I share with Outlook there is the file as attachment (fine) and the text as mail-body (not so fine).

If I open the sharing-charm there is a little arrow near the description of the data and I can choose "screenshot" instead of my data.

What I want: Offer at this point two or three DataPackages (with individuel titles and descriptions):

  • One for the file,
  • one for the text and
  • one for the HTML,

so the user can choose, wich format she wants to share.

The DataRequest-Object of the DataRequestedEventArgs offers one DataPackage (Data)...

Any ideas?


Solution

  • You cannot share multiple DataPackage at once...

    As a workaround you could give the user three actions (options) in your app, and depending on what he/she selects is what you would add as the DataPackage. Then you call the share charm yourself.

    Windows.ApplicationModel.DataTransfer.DataTransferManager.showShareUI();
    

    Of course you would have to have a decent default in case the user calls the share charm from the charm bar.