public MainVM() { gotoAdp = new RelayCommand(x => CurrentView = new AddPatientVM()); gotoSrch = new RelayCommand(x => CurrentView = new SearchPatientVM()); GoToPat = new RelayCommand(x => { CurrentView = new PatientProfileVM(Convert.ToInt32(x)); previousView = new SearchPatientVM(); }, x => HelpfulMethods.Checkdata(x)); PreviousPage = new RelayCommand(x => CurrentView = previousView); gotoApp = new RelayCommand(x => CurrentView = new AppointmentVM()); exit = new RelayCommand(x => ExitWindow(x)); }