“Only a single ContentDialog can be open at any time.” error while opening another contentdialog

前端 未结 6 1462
半阙折子戏
半阙折子戏 2020-12-04 00:29

I am using Windows.UI.Xaml.Controls.ContentDialog to show a confirmation. And based on the response from the first dialog I would (or would not) show another di

6条回答
  •  孤街浪徒
    2020-12-04 01:15

    Only a single ContentDialog can be open at any time.

    That is a fact. (I was really surprised, but just for a moment) You can't have more than one at any time and it is more like guideline from Microsoft, because it's really messy to have multiple dialogs on top of each other filled with content.

    Try to change your UX to display only one sophisticated ContentDialog and for all other messages use MessageDialog - it supports multiple buttons(only two for phones, but more on desktop) for user response but without Checkboxes or similar "smart"-content stuff.

    In my case MessageDialogs were really helpful, but in some areas I used chained ContentDialogs but for that you must await the first one, and open second right after without any exceptions. In your case it seems like ContentDialog was not fully closed when you tried to open next one.

    Hope it helps!

提交回复
热议问题