DataTransferManager.ShowShareUI | showShareUI method

Applies to Windows and Windows Phone

Programmatically initiates the user interface for sharing content with another app.

Syntax


Public Shared Sub ShowShareUI()

Parameters

This method has no parameters.

Remarks

We recommend that you use this method only when absolutely necessary. Users expect to launch the Share user interface through the Share charm. Launching the user interface programmatically can create a confusing user experience.

As a general rule, use this method only when it isn't obvious to a user that some content is shareable. For example, if a user gets a high score in a game, it may not be obvious that they can share that high score with their friends. In this situation, it makes sense to use the showShareUI method.

Examples

This example demonstrates how to call the ShowShareUI method to launch the Share user interface. Notice that this example only launches the interface—it does not add any content to share with another app.


function launchShare() {
    var shareButton = document.createElement("button");
    shareButton.setAttribute("id", "showShareButton");
    shareButton.innerText = "Click to share!";
    shareButton.addEventListener("click", function () {
        Windows.ApplicationModel.DataTransfer.DataTransferManager.showShareUI();
    });
    document.body.appendChild(shareButton);
}


Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8

Namespace

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

Metadata

Windows.winmd

See also

DataTransferManager

 

 

Show:
© 2014 Microsoft