User popup window before Prism 7.1 window is loaded - how?
up vote
0
down vote
favorite
I'm using Prism 7.1 WPF and Prism Unity.
Before the main <prism:PrismApplication/>
runs, or when the main Prism window appears, I want to have a modal pop-up window for user to input some data.
The input data would be for user login, and, more importantly, to determine which Prism modules to load into the application.
How would I go about doing this? I have tried to display a custom WPF window in the following PrismApplication
overload methods, but either the window doesn't appear, or the entire application closes:
public partial class App : PrismApplication
{
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
}
protected override IModuleCatalog CreateModuleCatalog()
{
return base.CreateModuleCatalog();
}
protected override void RegisterTypes(IContainerRegistry containerRegistry)
{
}
protected override Window CreateShell()
{
return ServiceLocator.Current.GetInstance<MainWindow>();
}
protected override void OnInitialized()
{
base.OnInitialized();
}
}
For example, if I put in a call to display a custom WPF window in the CreateModuleCatalog(), it will show, however the entire application closes:
protected override IModuleCatalog CreateModuleCatalog()
{
LoginWindow loginWindow = new LoginWindow();
if (loginWindow.ShowDialog() == true)
{
// OK
}
else
{
// Cancel
}
return base.CreateModuleCatalog();
}
... and if I put the call in OnStartup(), it won't show until all the other overrides are executed and the main Prism window is displayed (which is too late to process the user's input):
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
LoginWindow loginWindow = new LoginWindow();
if (loginWindow.ShowDialog() == true)
{
// OK
}
else
{
// Cancel
}
}
I've played around with the different methods, changed the position of the calls to the base class's method etc, but can't seem to get it working. Can anyone suggest how this can be done?
The reason for this is that I don't want to load entire modules into the application if I don't need to (based upon the user input).
Thanks....
c# wpf prism-7
add a comment |
up vote
0
down vote
favorite
I'm using Prism 7.1 WPF and Prism Unity.
Before the main <prism:PrismApplication/>
runs, or when the main Prism window appears, I want to have a modal pop-up window for user to input some data.
The input data would be for user login, and, more importantly, to determine which Prism modules to load into the application.
How would I go about doing this? I have tried to display a custom WPF window in the following PrismApplication
overload methods, but either the window doesn't appear, or the entire application closes:
public partial class App : PrismApplication
{
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
}
protected override IModuleCatalog CreateModuleCatalog()
{
return base.CreateModuleCatalog();
}
protected override void RegisterTypes(IContainerRegistry containerRegistry)
{
}
protected override Window CreateShell()
{
return ServiceLocator.Current.GetInstance<MainWindow>();
}
protected override void OnInitialized()
{
base.OnInitialized();
}
}
For example, if I put in a call to display a custom WPF window in the CreateModuleCatalog(), it will show, however the entire application closes:
protected override IModuleCatalog CreateModuleCatalog()
{
LoginWindow loginWindow = new LoginWindow();
if (loginWindow.ShowDialog() == true)
{
// OK
}
else
{
// Cancel
}
return base.CreateModuleCatalog();
}
... and if I put the call in OnStartup(), it won't show until all the other overrides are executed and the main Prism window is displayed (which is too late to process the user's input):
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
LoginWindow loginWindow = new LoginWindow();
if (loginWindow.ShowDialog() == true)
{
// OK
}
else
{
// Cancel
}
}
I've played around with the different methods, changed the position of the calls to the base class's method etc, but can't seem to get it working. Can anyone suggest how this can be done?
The reason for this is that I don't want to load entire modules into the application if I don't need to (based upon the user input).
Thanks....
c# wpf prism-7
Try to show the login window using theShowDialog()
method in theInitializeShell
method of the bootstrapper.
– mm8
Nov 13 at 10:12
Unfortunately, that did not work. While you are able to put theShowDialog()
method inInitialiseShell
, the other bootstrapper methods seem to fire prior to the Window being displayed no-matter-what. Thus, irrespective of whether I click OK or Cancel, theCreateModuleCatalog()
method fires, thus I cannot conditionally load modules at run time. Any other ideas?
– Jack
Dec 2 at 13:11
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm using Prism 7.1 WPF and Prism Unity.
Before the main <prism:PrismApplication/>
runs, or when the main Prism window appears, I want to have a modal pop-up window for user to input some data.
The input data would be for user login, and, more importantly, to determine which Prism modules to load into the application.
How would I go about doing this? I have tried to display a custom WPF window in the following PrismApplication
overload methods, but either the window doesn't appear, or the entire application closes:
public partial class App : PrismApplication
{
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
}
protected override IModuleCatalog CreateModuleCatalog()
{
return base.CreateModuleCatalog();
}
protected override void RegisterTypes(IContainerRegistry containerRegistry)
{
}
protected override Window CreateShell()
{
return ServiceLocator.Current.GetInstance<MainWindow>();
}
protected override void OnInitialized()
{
base.OnInitialized();
}
}
For example, if I put in a call to display a custom WPF window in the CreateModuleCatalog(), it will show, however the entire application closes:
protected override IModuleCatalog CreateModuleCatalog()
{
LoginWindow loginWindow = new LoginWindow();
if (loginWindow.ShowDialog() == true)
{
// OK
}
else
{
// Cancel
}
return base.CreateModuleCatalog();
}
... and if I put the call in OnStartup(), it won't show until all the other overrides are executed and the main Prism window is displayed (which is too late to process the user's input):
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
LoginWindow loginWindow = new LoginWindow();
if (loginWindow.ShowDialog() == true)
{
// OK
}
else
{
// Cancel
}
}
I've played around with the different methods, changed the position of the calls to the base class's method etc, but can't seem to get it working. Can anyone suggest how this can be done?
The reason for this is that I don't want to load entire modules into the application if I don't need to (based upon the user input).
Thanks....
c# wpf prism-7
I'm using Prism 7.1 WPF and Prism Unity.
Before the main <prism:PrismApplication/>
runs, or when the main Prism window appears, I want to have a modal pop-up window for user to input some data.
The input data would be for user login, and, more importantly, to determine which Prism modules to load into the application.
How would I go about doing this? I have tried to display a custom WPF window in the following PrismApplication
overload methods, but either the window doesn't appear, or the entire application closes:
public partial class App : PrismApplication
{
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
}
protected override IModuleCatalog CreateModuleCatalog()
{
return base.CreateModuleCatalog();
}
protected override void RegisterTypes(IContainerRegistry containerRegistry)
{
}
protected override Window CreateShell()
{
return ServiceLocator.Current.GetInstance<MainWindow>();
}
protected override void OnInitialized()
{
base.OnInitialized();
}
}
For example, if I put in a call to display a custom WPF window in the CreateModuleCatalog(), it will show, however the entire application closes:
protected override IModuleCatalog CreateModuleCatalog()
{
LoginWindow loginWindow = new LoginWindow();
if (loginWindow.ShowDialog() == true)
{
// OK
}
else
{
// Cancel
}
return base.CreateModuleCatalog();
}
... and if I put the call in OnStartup(), it won't show until all the other overrides are executed and the main Prism window is displayed (which is too late to process the user's input):
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
LoginWindow loginWindow = new LoginWindow();
if (loginWindow.ShowDialog() == true)
{
// OK
}
else
{
// Cancel
}
}
I've played around with the different methods, changed the position of the calls to the base class's method etc, but can't seem to get it working. Can anyone suggest how this can be done?
The reason for this is that I don't want to load entire modules into the application if I don't need to (based upon the user input).
Thanks....
c# wpf prism-7
c# wpf prism-7
asked Nov 10 at 3:56
Jack
907
907
Try to show the login window using theShowDialog()
method in theInitializeShell
method of the bootstrapper.
– mm8
Nov 13 at 10:12
Unfortunately, that did not work. While you are able to put theShowDialog()
method inInitialiseShell
, the other bootstrapper methods seem to fire prior to the Window being displayed no-matter-what. Thus, irrespective of whether I click OK or Cancel, theCreateModuleCatalog()
method fires, thus I cannot conditionally load modules at run time. Any other ideas?
– Jack
Dec 2 at 13:11
add a comment |
Try to show the login window using theShowDialog()
method in theInitializeShell
method of the bootstrapper.
– mm8
Nov 13 at 10:12
Unfortunately, that did not work. While you are able to put theShowDialog()
method inInitialiseShell
, the other bootstrapper methods seem to fire prior to the Window being displayed no-matter-what. Thus, irrespective of whether I click OK or Cancel, theCreateModuleCatalog()
method fires, thus I cannot conditionally load modules at run time. Any other ideas?
– Jack
Dec 2 at 13:11
Try to show the login window using the
ShowDialog()
method in the InitializeShell
method of the bootstrapper.– mm8
Nov 13 at 10:12
Try to show the login window using the
ShowDialog()
method in the InitializeShell
method of the bootstrapper.– mm8
Nov 13 at 10:12
Unfortunately, that did not work. While you are able to put the
ShowDialog()
method in InitialiseShell
, the other bootstrapper methods seem to fire prior to the Window being displayed no-matter-what. Thus, irrespective of whether I click OK or Cancel, the CreateModuleCatalog()
method fires, thus I cannot conditionally load modules at run time. Any other ideas?– Jack
Dec 2 at 13:11
Unfortunately, that did not work. While you are able to put the
ShowDialog()
method in InitialiseShell
, the other bootstrapper methods seem to fire prior to the Window being displayed no-matter-what. Thus, irrespective of whether I click OK or Cancel, the CreateModuleCatalog()
method fires, thus I cannot conditionally load modules at run time. Any other ideas?– Jack
Dec 2 at 13:11
add a comment |
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53235878%2fuser-popup-window-before-prism-7-1-window-is-loaded-how%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53235878%2fuser-popup-window-before-prism-7-1-window-is-loaded-how%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Try to show the login window using the
ShowDialog()
method in theInitializeShell
method of the bootstrapper.– mm8
Nov 13 at 10:12
Unfortunately, that did not work. While you are able to put the
ShowDialog()
method inInitialiseShell
, the other bootstrapper methods seem to fire prior to the Window being displayed no-matter-what. Thus, irrespective of whether I click OK or Cancel, theCreateModuleCatalog()
method fires, thus I cannot conditionally load modules at run time. Any other ideas?– Jack
Dec 2 at 13:11