Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dialog not showing when the first DialogContainer is not yet created #9

Open
schdck opened this issue Aug 20, 2019 · 0 comments
Open
Labels
enhancement An enhancement to the framework
Milestone

Comments

@schdck
Copy link
Owner

schdck commented Aug 20, 2019

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)

@schdck schdck added the enhancement An enhancement to the framework label Aug 20, 2019
@schdck schdck added this to the v2.0 milestone Aug 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement to the framework
Projects
None yet
Development

No branches or pull requests

1 participant