Beispiel #1
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            //C'est ici, dans la méthode Application_Startup, qu'on instancie nos objets Dbal et Dao
            thedbal      = new dbal("foot_americainDB");
            thedaopays   = new DAOpays(thedbal);
            thedaoposte  = new DAOposte(thedbal);
            thedaoequipe = new DAOequipe(thedbal, thedaojoueur);
            thedaojoueur = new DAOjoueur(thedbal, thedaopays, thedaoposte, thedaoequipe);

            // Create the startup window
            //là, on lance la fenêtre souhaitée en instanciant la classe de notre fenêtre
            MainWindow wnd = new MainWindow(thedaopays, thedaoequipe, thedaojoueur, thedaoposte);

            //et on utilise la méthode Show() de notre objet fenêtre pour afficher la fenêtre
            //exemple: MainWindow lafenetre = new MainWindow(); (et on y passe en paramètre Dbal et Dao au besoin)
            wnd.Show();
        }
 public MainWindow(DAOpays thedaopays, DAOequipe thedaoequipe, DAOjoueur thedaojoueur, DAOposte thedaoposte)
 {
     InitializeComponent();
     Globale.DataContext = new viewModel.viewModelJoueur(thedaopays, thedaoposte, thedaojoueur, thedaoequipe);
 }