The problem you are facing here is that you cannot stack multiple message dialogs on top of each other -- e.g you can only display one at a time. I solved this in my application using the following code:
(function () {
var alertsToShow = [];
var dialogVisible = false;
function showPendingAlerts() {
if (dialogVisible || !alertsToShow.length) {
return;
}
dialogVisible = true;
(new Windows.UI.Popups.MessageDialog(alertsToShow.shift())).showAsync().done(function () {
dialogVisible = false;
showPendingAlerts();
})
}
window.alert = function (message) {
if (window.console && window.console.log) {
window.console.log(message);
}
alertsToShow.push(message);
showPendingAlerts();
}
})();
This will queue them up and display them one-after the other in succession. Clearly this won't work for your case, but this should be a good starting point. :)