Ejemplo n.º 1
0
        // Respondsible for resetting view to home / alter view when notification message is sent by other
        // classes containing any of the values below
        private void ChangeView(string value)
        {
            ViewModelLocator.Cleanup();

            if (value == "LoginView")
            {
                CurrentViewModel = LoginVM;
            }
            if (value == "HomeView")
            {
                CurrentViewModel        = HomeVM;
                CurrentToolbarViewModel = HomeToolbarVM;
                ViewModelLocator.Cleanup();
            }
            if (value == "DecideHomeView")
            {
                if (CurrentToolbarViewModel.GetType().ToString() == "Appointment_Mgr.ViewModel.ReceptionistToolbarViewModel")
                {
                    CurrentViewModel = ReceptionistVM;
                }
                else if (CurrentToolbarViewModel.GetType().ToString() == "Appointment_Mgr.ViewModel.HomeToolbarViewModel")
                {
                    CurrentViewModel        = HomeVM;
                    CurrentToolbarViewModel = HomeToolbarVM;
                }
            }

            if (value == "BookingView")
            {
                CurrentViewModel = BookingVM;
            }
            if (value == "EmergencyBookingView")
            {
                CurrentViewModel = EmergencyBookingVM;
            }

            if (value == "ReceptionistHomeView")
            {
                CurrentViewModel = ReceptionistVM;
            }

            if (value == "ManageAppointmentsView")
            {
                CurrentViewModel = ManageAppointmentsVM;
            }

            if (value == "WaitingListView")
            {
                CurrentViewModel = ManageWaitListVM;
            }

            if (value == "ManagePatientView")
            {
                CurrentViewModel = ManagePatientVM;
            }

            if (value == "CheckInView")
            {
                CurrentViewModel = CheckInVM;
            }

            if (value == "DoctorHomeView")
            {
                CurrentViewModel = DoctorVM;
            }
            if (value == "DoctorAppointmentView")
            {
                CurrentViewModel = DoctorAppointmentVM;
                MessengerInstance.Send <int>(UserID);
            }
        }
 public override void Cleanup()
 {
     MessengerInstance.Unregister(this);
     base.Cleanup();
     ViewModelLocator.Cleanup();
 }