-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Prism.Wpf: InitializeModules() should be called even if there's no shell #1601
Comments
What value are you getting out of Prism for WPF if you have no views/regions? Also, how do you prevent your modules from crashing since no regions exist in the app to inject any views? What exactly do these modules do? |
More or less only that it will load my modules. /edit: |
Normally, I would say this isn't something I would allow. However, I do see that the old bootstrapper did allow for this, and the code changes are very minimal to support it. So I will merge your PR. Thanks for that by the way :) |
Load modules without a shell in WPF applications (#1601)
This has been fixed. You can test out the changes in the latest CI build on our MyGet feeed when the build has completed in about 20 minutes. |
Just checked 7.1.0.559-ci and it works fine. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description
PrismApplicationBase.cs has this code right now:
My application can also run as a consol application and in that case I want the modules even though there's no shell.
My current workaround is to call InitializeModules() myself in CreateShell() but this seems fragile.
Is there a reason InitializeModules() is only called if there's a shell?
Another point is that OnInitialized() crashes if there's no shell because MainWindow is null. So right now if there's no shell the application crashes if OnInitialized() is not overwritten and the base method not called.
The text was updated successfully, but these errors were encountered: