I have a problem with ContentDialog, as you knew, a ContentDialog can be dismissed when we tap to its button, but now, I want to dismiss this by tapping to the out site section of it. How to do that? Please help me!
When you calling the ShowAsync method of ContentDialog pass the CancellationTokenSource(cts);
CancellationTokenSource cts;
cts = new CancellationTokenSource();
contentDialog.ShowAsync().AsTask(cts.Token);
listen for Tapped event of the page. Cancel the task(ContenDialog task) inside event method like below
void Page_Tapped(object sender, TappedRoutedEventArgs e)
{
contentDialog.Hide();
cts.Cancel();
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.