Exemplo n.º 1
0
        public ReorderViewModel([NotNull] BaseCardProvider cardProvider,
            [NotNull] ICollectionFactory collectionFactory, [NotNull] StatisticsService statistics)
        {
            if (cardProvider == null) throw new ArgumentNullException("cardProvider");
            if (collectionFactory == null) throw new ArgumentNullException("collectionFactory");
            if (statistics == null) throw new ArgumentNullException("statistics");

            _cardProvider = cardProvider;
            _statistics = statistics;

            Cards = collectionFactory.GetCollection<CardViewModel>();
            LoadData();
            ApplyChangesCommand = new RelayCommand(_ => SaveChanges());
            _statistics.PublishReorderPageLoaded();
        }
Exemplo n.º 2
0
        public MainViewModel([NotNull] INavigationService navigation, [NotNull] BaseCardProvider cardProvider,
            [NotNull] ICollectionFactory collectionFactory, [NotNull] StatisticsService statistics)
        {
            if (navigation == null) throw new ArgumentNullException("navigation");
            if (cardProvider == null) throw new ArgumentNullException("cardProvider");
            if (collectionFactory == null) throw new ArgumentNullException("collectionFactory");
            if (statistics == null) throw new ArgumentNullException("statistics");

            _navigation = navigation;
            _cardProvider = cardProvider;
            _statistics = statistics;

            Cards = collectionFactory.GetCollection<CardViewModel>();
            InitCommands();
            LoadData();
            _statistics.PublishMainPageLoaded(Cards == null ? 0 : Cards.Count);
        }
Exemplo n.º 3
0
 public EditCardViewModel([NotNull] INavigationService navigation, [NotNull] BaseCardProvider cardProvider,
     [NotNull] ISecondaryTileService secondaryTileService,
     [NotNull] StatisticsService statistics,
     [NotNull] IUiStringsProvider stringsProvider, int id)
 {
     if (navigation == null) throw new ArgumentNullException("navigation");
     if (cardProvider == null) throw new ArgumentNullException("cardProvider");
     if (secondaryTileService == null) throw new ArgumentNullException("secondaryTileService");
     if (statistics == null) throw new ArgumentNullException("statistics");
     if (stringsProvider == null) throw new ArgumentNullException("stringsProvider");
     _navigation = navigation;
     _cardProvider = cardProvider;
     _secondaryTileService = secondaryTileService;
     _statistics = statistics;
     _stringsProvider = stringsProvider;
     Card = _cardProvider.GetById(id).ToViewModel();
     _statistics.PublishEditPageLoaded();
 }
Exemplo n.º 4
0
 public NewCardViewModel([NotNull] INavigationService navigation, [NotNull] BaseCardProvider cardProvider,
                         [NotNull] IUiStringsProvider stringsProvider, [NotNull] StatisticsService statistics)
 {
     if (stringsProvider == null) throw new ArgumentNullException("stringsProvider");
     if (statistics == null) throw new ArgumentNullException("statistics");
     _navigation = navigation;
     _cardProvider = cardProvider;
     _stringsProvider = stringsProvider;
     _statistics = statistics;
     Card = new CardViewModel();
     IsSixDigitsPin = false;
     Card.ReadyToSave += () =>
         {
             _canSave = true;
             SaveCommand.RaiseCanExecuteChanged();
         };
     Card.NameOfDescriptionUpdated += () => SaveCommand.RaiseCanExecuteChanged();
     _statistics.PublishNewCardPageLoaded();
 }
Exemplo n.º 5
0
 public TestDataGenerator([NotNull] BaseCardProvider cardProvider)
 {
     if (cardProvider == null) throw new ArgumentNullException("cardProvider");
     _cardProvider = cardProvider;
 }