Exemple #1
0
        //public event PropertyChangedEventHandler PropertyChanged = delegate { };

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

            //SportsEvents = new ObservableCollection<SportsEvent>(_repo.GetSportsEventsAsync().Result);
            DeleteCommand = new RelayCommand(OnDelete, CanDelete);

            AddSportsEventCommand  = new RelayCommand(OnAddSportsEvent);
            EditSportsEventCommand = new RelayCommand <SportsEvent>(OnEditSportsEvent);
            ClearSearchCommand     = new RelayCommand(OnClearSearch);
        }
Exemple #2
0
 public SportsEventFormViewModel(ISportsEventsRepository repo)
 {
     _repo         = repo;
     CancelCommand = new RelayCommand(OnCancel);
     SaveCommand   = new RelayCommand(OnSave, CanSave);
 }