public MainPageViewModel(INavigation navigation, ILentItemsRepository repository)
        {
            _navigation = navigation;
            _repository = repository;
            NavigateToAddLentItemCommand = new Command(NavigateToAddLentItem);
            NavigateToLentItemsCommand   = new Command(NavigateToLentItems);
            NavigateToPersonsCommand     = new Command(NavigateToPersons);

            _items           = _repository.GetAll();
            LentCount        = _items.Count();
            LentOverDueCount = _items.Count(x => x.DueDate < DateTime.Today);
        }
 public AddLentITemPageViewModelTests()
 {
     _repository = Substitute.For <ILentItemsRepository>();
     _nav        = NSubstitute.Substitute.For <INavigation>();
     _vm         = new AddLentItemPageViewModel(_nav, _repository);
 }
Ejemplo n.º 3
0
 public AddLentItemPageViewModel(INavigation navigation, ILentItemsRepository repository)
 {
     _navigation = navigation;
     _repository = repository;
     SaveCommand = new Command(Save);
 }