Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Close Content Dialog in Code Behind

Tags:

uwp

I have a content dialog with a textbox and I would like to close the dialog when I hit enter in the textbox. Is there a way to achieve that without click on the primary button?

like image 546
NPadrutt Avatar asked Dec 01 '15 17:12

NPadrutt


1 Answers

ContentDialog.Hide() hide the dialog, then the call of ShowAsync returned. I can't guarantee that the call is same with primary button, but it's enough for me. :)

https://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.contentdialog.hide

like image 107
Mamoru Satoh Avatar answered Oct 14 '22 07:10

Mamoru Satoh