I have a Windows Store app that creates extra tiles. When I clicked the tile, I want the application to execute, which is an effective, stand-alone function (that is, I do not want to return to the application, but I want the application to do something and then exit). Therefore, in this case, I want to start the mail client, for example. Here, where I am still:
app.addEventListener("activated", function (args) {
if (args.detail.kind === activation.ActivationKind.launch) {
if (args.detail.arguments !== "") {
args.setPromise(WinJS.UI.processAll().done(function () {
var emailaddress = args.detail.arguments;
var promise = Email.SendNewMail.sendEmail(emailaddress);
return;
}));
} else if (args.detail.previousExecutionState !== activation.ApplicationExecutionState.terminated) {
} else {
}
...
Email function here:
sendEmail: function sendEmail(addess, subject, body) {
var mailto = new Windows.Foundation.Uri("mailto:?to=" + addess + "&subject=" + subject + "&body=" + body);
return Windows.System.Launcher.launchUriAsync(mailto);
}
The error that I am currently getting is "The object is disconnected from its client", which I believe is caused by the program exiting before the promise is completed. How can this behavior be achieved in WInRT?
UPDATE:
MS , , , 3.6.