2025-11-28 00:35:46 +09:00

3.6 KiB

WPF Sharing content source app sample

Shows how a managed Win32 app can participate in the Share contract. There is a corresponding Sharing content UWP source app sample available.

Some of the classes you might want to review in more detail are the DataTransferManager class, which you use to initiate a share operation, and the DataPackage class, which you use to package the content. Because each share scenario usually involves two apps (the source app and a target app that receives the content) we recommend you install and deploy the Sharing content target app sample when you install and run this one. This way, you can see how sharing works from end to end.

Note Win32 is not supported for Sharing content target apps.

This sample covers how to share content in a variety of formats, including:

  • Text
  • Web link
  • Files

Note This sample requires Visual Studio 2015 to build and Windows 10 to execute.

To obtain information about Windows 10 development, go to the Windows Dev Center

To obtain information about Microsoft Visual Studio 2015 and the tools for developing Windows apps, go to Visual Studio 2015

Reference

To learn more about sharing and the Windows.ApplicationModel.DataTransfer namespace, we recommend you take a look at the Sharing and exchanging data section of our documentation, which describes how sharing works and contains several how-to topics that cover how to share text, an image, files, and other formats. Our Guidelines for sharing content can also help you create a great user experience with the share feature.

For more info about the concepts and APIs demonstrated in this sample, see these topics: