在 Windows RT 中打开页面时显示消息框

Show message box when page opens in Windows RT

如何在页面打开时显示消息框?这是我的 WP 项目的代码,但我想知道它的 WinRT 版本。

    protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
    {
        base.OnNavigatedTo(e);

        CustomMessageBox messageBox = new CustomMessageBox()
        {
            Caption = "",
            Message = "",
            LeftButtonContent = "ok"
        };

        messageBox.Show();
    }

MessageDialog class 可用于此目的

查看: https://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.popups.messagedialog?cs-save-lang=1&cs-lang=csharp#code-snippet-1