//public event PropertyChangedEventHandler PropertyChanged = delegate { };

        public GuardianListViewModel(IGuardiansRepository repo)
        {
            _repo = repo;
            //if (DesignerProperties.GetIsInDesignMode(
            //	new System.Windows.DependencyObject())) return;

            //Guardians = new ObservableCollection<Guardian>(_repo.GetGuardiansAsync().Result);
            DeleteCommand = new RelayCommand(OnDelete, CanDelete);

            AddGuardianCommand  = new RelayCommand(OnAddGuardian);
            EditGuardianCommand = new RelayCommand <Guardian>(OnEditGuardian);
            ClearSearchCommand  = new RelayCommand(OnClearSearch);
        }
예제 #2
0
 public GuardianFormViewModel(IGuardiansRepository repo)
 {
     _repo         = repo;
     CancelCommand = new RelayCommand(OnCancel);
     SaveCommand   = new RelayCommand(OnSave, CanSave);
 }