Exemplo n.º 1
0
 private void Delete()
 {
     _dialogService.ShowDialog("ClinicNotificationView", r =>
     {
         if (r.Result == ButtonResult.Yes)
         {
             repo.Delete(SelectedVisit);
             Visits     = new ObservableCollection <DoctorVisit>(repo.GetAll());
             VisitCount = repo.GetDoctorVisitCount().ToString();
         }
     });
 }
Exemplo n.º 2
0
 public VisitsListViewModel(IRegionManager regionManager, IDialogService dialogService)
 {
     _regionManager  = regionManager;
     _dialogService  = dialogService;
     repo            = new DoctorVisitRepo(new ClinicAppDAL.EF.ClinicAppClinicContext());
     Visits          = new ObservableCollection <DoctorVisit>(repo.GetAll());
     SelectedCommand = new DelegateCommand <DoctorVisit>(Selected);
     DeleteCommand   = new DelegateCommand(Delete, canDelete).ObservesProperty(() => SelectedVisit);
     ChangeCommand   = new DelegateCommand(Change, canDelete).ObservesProperty(() => SelectedVisit);
     AddCommand      = new DelegateCommand(Add);
     SearchCommand   = new DelegateCommand(Search);
     VisitCount      = repo.GetDoctorVisitCount().ToString();
     SearchText      = DateTime.Now;
 }