예제 #1
0
        public MainWindowViewModel()
        {
            GMedecinCommand = new RelayCommand(() =>
            {
                GestionMedecinWindow w = new GestionMedecinWindow();
                w.Show();
            });
            GPatientCommand = new RelayCommand(() =>
            {
                GestionPatientWindow w = new GestionPatientWindow();
                w.Show();
            });
            GRdvCommand = new RelayCommand(() =>
            {
                GestionRendezVousWindow w = new GestionRendezVousWindow();
                w.Show();
            });
            CToutCommand = new RelayCommand(() =>
            {
                CToutWindow w = new CToutWindow();
                w.Show();
            });
            CParDateCommand = new RelayCommand(() =>
            {
                CParDateWindow w = new CParDateWindow();
                w.Show();
            });
            CParClientCommand = new RelayCommand(() =>
            {
                CParClientWindow w = new CParClientWindow();
                w.Show();
            });

            QuitterCommand = new RelayCommand(() =>
            {
                //pour fermer la fenetre active
                Application.Current.Windows.Cast <Window>().FirstOrDefault(x => x.IsActive).Close();

                //pour fermer toutes les fenetres
                //foreach(Window w  in Application.Current.Windows)
                //{
                //    w.Close();
                //}
            });
        }
예제 #2
0
        public MainWindowViewModel()
        {
            medecin         = new Medecin();
            rendezVous      = new RendezVous();
            patient         = new Patient();
            listeRendezVous = Database.Instance.getRendezVous();

            GMedecinCommand = new RelayCommand(() =>
            {
                GestionMedecinWindow w = new GestionMedecinWindow();
                w.Show();
            });

            GPatientCommand = new RelayCommand(() =>
            {
                GestionPatientWindow w = new GestionPatientWindow();
                w.Show();
            });

            GRDVCommand = new RelayCommand(() =>
            {
                GestionRendezVousWindow w = new GestionRendezVousWindow();
                w.Show();
            });

            CToutConsultationCommand = new RelayCommand(() =>
            {
                CParToutWindow w = new CParToutWindow();
                w.Show();
            });

            CRechercheParDateCommand = new RelayCommand(() =>
            {
                CParRendezVousWindow w = new CParRendezVousWindow();
                w.Show();
            });

            CRendezVousPatientCommand = new RelayCommand(() =>
            {
                CParClientWindow w = new CParClientWindow();
                w.Show();
            });
        }