Skip to main content
DataTransferManager class

Programmatically initiates an exchange of content with other apps.


var dataTransferManager = Windows.ApplicationModel.DataTransfer.DataTransferManager.getForCurrentView();

public sealed class DataTransferManager

Public NotInheritable Class DataTransferManager

public ref class DataTransferManager sealed 


The DataTransferManager class has these types of members:


The DataTransferManager class has these events.

DataRequested Occurs when a share operation starts.
TargetApplicationChosen Occurs when the user chooses a target app in the Share charm.



The DataTransferManager class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.

GetForCurrentView Returns the DataTransferManager object associated with the current window.
ShowShareUI Programmatically initiates the user interface for sharing content with another app.



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. In general, we recommend against using this method. Users expect to initiate share operations by using the Share charm—when you launch the operation programmatically, you can create an inconsistent user experience. We include the method because there are a few scenarios in which the user might not recognize opportunities to share. A good example is when the user achieves a high score in a game.

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.


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

    function setupShare() {
        var dataTransferManager = Windows.ApplicationModel.DataTransfer.DataTransferManager.getForCurrentView();
        dataTransferManager.addEventListener("datarequested", function (e) {
            var request = e.request;
   = "Share Demonstration";
  "Hello World!");

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0 [for Xbox, see UWP features that aren't yet supported on Xbox]

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0


Windows::ApplicationModel::DataTransfer [C++]



Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8


Windows::ApplicationModel::DataTransfer [C++]




[ MarshalingBehavior(Standard)]
[ Muse()]
[ Version(0x06020000)]

See also

Sharing content source app sample (Windows 10)