处理回调需要用到C++/CX 异步编程
void _xxx::MainPage::bre_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{
ContentDialog^ dialog = ref new ContentDialog;
dialog->Title = "标题";
dialog->Content = "内容";
dialog->PrimaryButtonText = "确定";
dialog->CloseButtonText = "取消";
//设置默认高亮按钮
dialog->DefaultButton = ContentDialogButton::Close;
IAsyncOperation<ContentDialogResult>^ task = dialog->ShowAsync();
create_task(task).then([this](ContentDialogResult result) {
if (result == ContentDialogResult::Primary){
//操作
}
});
}