简体   繁体   中英

How to hide(close) previously opened ContentDialog in uwp

Only single ContentDialog will be opened. While opening second dialog, how would i know that ContentDialog is already opened and how to call its hide()?

Tried with VisualTreeHelper.GetOpenPopups(Window.Current) but no use.

Derive from official document , there can only be one ContentDialog open per thread at a time. Attempting to open two ContentDialogs will throw an exception, even if they are attempting to open in separate AppWindows.

So you don't need to hide previously opened ContentDialog in uwp. When you could show a ContentDialog, it indicates that only this ContentDialog is opened in the current thread.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM