(本記事はVisualStudio2012RC+Windows8RP環境で確認しております。製品版では動作が異なる可能性があるのでご注意ください。)
MetroスタイルアプリケーションのHTML+JSでダイアログを出す方法
var msg = new Windows.UI.Popups.MessageDialog("本文", "タイトル");
msg.commands.append(new Windows.UI.Popups.UICommand("OK",
function (command) {
Debug.writeln("OK");
}));
msg.commands.append(new Windows.UI.Popups.UICommand("Cancel",
function (command) {
Debug.writeln("Cancel");
}));
msg.showAsync();
ちなみにC#版は以下、
MessageDialog dialog = new MessageDialog("本文", "タイトル");
dialog.Commands.Add(new UICommand("OK"));
dialog.Commands.Add(new UICommand("Cancel"));
await dialog.ShowAsync();
Please give us your valuable comment