You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to show a dialog before the first DialogContainer is created, there's no one subscribed to DialogManager, so it sillently fails (no exception is thrown, because it is configured to just return null).
I think this behavior is very confusing and should be changed. Right now, I think the possibilities are:
Option A: Throw an exception instead of just returning null (this could be usefull when the user forgot to create a DialogContainer, but would make the process of showing a dialog before the window was created very painful¹)
Option B: Add the shown dialog to the Stack and display it as soon as someone subscribe
In case we choose Option B, something to keep in mind is: what Task to return from ShowDialogAsync/ShowDialogForResult? Since the Stack is implemented on the DialogContainer and there's none, another Stack would need to be implemented on the DialogManager.
¹ Imagine a scenario where the application loads some data on startup and it fails. So you catch the exception and try to display a dialog with it, but your window is not yet initialized (because your application is just starting up). As I see, if we were to thrown an Exception, user would need to either move the load data code to after the Window is initialized and the DialogContainer is created (which can be good sometimes, but is not something I want to force on users) or just show the dialog after the DialogContainer is created (which is almost the same thing as Option A, but done in the the end-user code instead of here)
The text was updated successfully, but these errors were encountered:
When trying to show a dialog before the first
DialogContainer
is created, there's no one subscribed toDialogManager
, so it sillently fails (no exception is thrown, because it is configured to just return null).I think this behavior is very confusing and should be changed. Right now, I think the possibilities are:
DialogContainer
, but would make the process of showing a dialog before the window was created very painful¹)In case we choose Option B, something to keep in mind is: what Task to return from
ShowDialogAsync
/ShowDialogForResult
? Since the Stack is implemented on theDialogContainer
and there's none, another Stack would need to be implemented on theDialogManager
.¹ Imagine a scenario where the application loads some data on startup and it fails. So you catch the exception and try to display a dialog with it, but your window is not yet initialized (because your application is just starting up). As I see, if we were to thrown an Exception, user would need to either move the load data code to after the
Window
is initialized and theDialogContainer
is created (which can be good sometimes, but is not something I want to force on users) or just show the dialog after theDialogContainer
is created (which is almost the same thing as Option A, but done in the the end-user code instead of here)The text was updated successfully, but these errors were encountered: