Skip to content

Latest commit

 

History

History
47 lines (31 loc) · 2.54 KB

datatransfermanager.md

File metadata and controls

47 lines (31 loc) · 2.54 KB
-api-id -api-type -api-device-family-note
T:Windows.ApplicationModel.DataTransfer.DataTransferManager
winrt class
xbox

Windows.ApplicationModel.DataTransfer.DataTransferManager

-description

Programmatically initiates an exchange of content with other apps.

-remarks

The DataTransferManager class is a static class that you use to initiate sharing operations. To use the class, first call the GetForCurrentView method. This method returns the DataTransferManager object that is specific to the active window. Next, you need to add an event listener for the datarequested event to the object. This event is fired when a sharing operation starts— typically when the user taps the Share charm, although it is also fired if your app starts a share operation programmatically.

The DataTransferManager class includes a ShowShareUI method, which you can use to programmatically start a share operation.

The DataTransferManager class also has a TargetApplicationChosen event. Use this event when you want to capture what applications a user selects when sharing content from your app.

Note

This class is not agile, which means that you need to consider its threading model and marshaling behavior. For more info, see Threading and Marshaling (C++/CX) and Using Windows Runtime objects in a multithreaded environment (.NET).

Windows Phone 8

This API is supported in native apps only.

Version history

Windows version SDK version Value added
1607 14393 IsSupported
1703 15063 ShareProvidersRequested
1709 16299 ShowShareUI(ShareUIOptions)

-examples

This example shows a typical way of using the DataTransferManager object.

[!code-jsDataTransferManager_1]

-see-also

Sharing content source app sample (Windows 10)