Quantcast
Viewing all articles
Browse latest Browse all 31927

General question concerning Application- Class, in use with WPF

Hey!

I have a WPF project WITHOUT the app.xaml in Visual Studio and I am trying to control my application with a custom made class. This looks something like that: 

class ablaufSteuerung
    {
        [STAThread]
        public static void Main()
        {
            Application app = new Application();
            hauptfenster_spaceCheck hauptFenster = new hauptfenster_spaceCheck();
            app.Run(hauptFenster);

            Wahlfenster_spaceCheck wahlFenster = new Wahlfenster_spaceCheck();
            wahlFenster.ShowDialog();
        }
    }

What I don´t understand now, is, why after executing the program, the "hauptFenster" is displayed and the execution seems to stop. "wahlFenster.ShowDialog()" is not reached somehow.

I can solve this with some user interaction in the "hauptfenster" but, I don´t want to do that, I just want the "hauptFenster" to appear and in front of it the dialog.

Where is my mistake? And I´m sorry for the german class names and variables.


Viewing all articles
Browse latest Browse all 31927

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>