Note that there are some explanatory texts on larger screens.

plurals
  1. POApp xaml assumes the first window instantiated is the main window (showdialog is ignored), I need to show multiple windows
    primarykey
    data
    text
    <p>I have the following code in my App.xaml.cs</p> <pre><code>private void App_Start(object sender, StartupEventArgs e) { if ( CompletedInstall()) { //using show to allow for pacifier if loading is slow var manager = new WINServiceConfig(); MainWindow = manager; manager.ShowDialog(); } } private bool CompletedInstall() { var window = new Initialize(); window.ShowDialog(); return window.DoLaunchManager; } </code></pre> <p>and the following in the App.xaml</p> <pre><code>&lt;Application x:Class="Manager.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Startup="App_Start"&gt; </code></pre> <p>When i comment out the line that checks <strong>CompletedInstall()</strong> the <strong>manager.ShowDialog()</strong> works fine, and my configuration window shows. When <strong>CompletedInstall()</strong> is called the call to <strong>manager.ShowDialog()</strong> returns right away without displaying the window. I added the main window on the assumption that somewhere along the line someone decided an app should only show one window.</p> <p>I found a workaround by setting the main window before calling CompletedInstall</p> <pre><code> private void App_Start(object sender, StartupEventArgs e) { var manager = new WINServiceConfig(); MainWindow = manager; if (CompletedInstall()) { manager.ShowDialog(); } </code></pre> <p>but this forces me to develop WINServiceConfig (specifically the constructor) based on its use, because it cannot count on the prerequisites being completed. This is bad form. What else can i do to get around this problem? </p> <p>Dummy window? That can't be the best answer. Can it??</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload