The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

DataTransferManager.DataRequested | datarequested event

Applies to Windows and Windows Phone

Occurs when a share operation starts.


function onDataRequested(eventArgs) { /* Your code */ }
// addEventListener syntax
dataTransferManager.addEventListener("datarequested", onDataRequested);
dataTransferManager.removeEventListener("datarequested", onDataRequested);
- or -

dataTransferManager.ondatarequested = onDataRequested;

Event information

Delegate TypedEventHandler<DataTransferManager, DataRequestedEventArgs>


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. To handle this event, you need to add an event listener to the DataTransferManager object for the active window. You can get this object through the GetForCurrentView method.

When handling a datarequested event, the most important property you need to be aware of is its request property. This property contains a DataRequest object. Your app uses this object to provide the data that the user wants to share with a selected target app.


This example uses an inline function to handle a datarequested event.

function registerForShare() {
    var dataTransferManager = Windows.ApplicationModel.DataTransfer.DataTransferManager.getForCurrentView();
    dataTransferManager.addEventListener("datarequested", shareTextHandler);

function shareTextHandler(e) {
    var request = e.request; = "Share Text Example"; = "A demonstration that shows how to share.";"Hello World!");


Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8


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



See also




© 2014 Microsoft