5
votes

My Windows 8 app written in JavaScript allows the user to share while in certain views. When the user is in a view that does not allow sharing the Share charm says "This app can't share." How can I change the wording to "There's nothing to share right now."

The Windows 8 help file says:

"Provide a message to the user when sharing cannot be completed If your app supports sharing but a particular sharing operation cannot be completed for some reason, provide a message to be displayed in the share window that describes the steps that the user must take to correct the problem."

But it doesn't specify how to change the default sharing message? Thanks in advance for your help.

1

1 Answers

3
votes

you need to Work with the failWithDisplayText

var dataTransferManager = Windows.ApplicationModel.DataTransfer.DataTransferManager.getForCurrentView();
dataTransferManager.addEventListener("datarequested", dataRequested);

function dataRequested(e) {
    var request = e.request;
    request.failWithDisplayText("Select a news story and then try again");
}

sufficient? :)