If you build a windows 8 application and don’t implement sharing on a specific page, when a user presses the Windows 8 share charm the default text that is displayed says “This app can’t share” it maybe the case that other pages can share or that you plan to add sharing into a future version so changing this text is useful to give the user more information. For example you might want to say “You can’t share right now, select a news story and then try again”.

To do this we wire up the share contract as we normal would, but rather than providing a dataTransfer object we set 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");
}