获取messagedialog用户点击的按钮

        private async void Button_Click_1(object sender, RoutedEventArgs e)
        {
            MessageDialog msgdlg = new MessageDialog("是否删除?");
            msgdlg.Commands.Add(new UICommand("") { Id = 1 });
            msgdlg.Commands.Add(new UICommand("") { Id = 2 });
            var result = await msgdlg.ShowAsync();
            if ((int)result.Id == 1) { }
        }

 

你可能感兴趣的:(message)