Exemplo n.º 1
0
        public AboutViewModel([NotNull] IPlatformTaskFactory platformTaskFactory, [NotNull] StatisticsService statistics)
        {
            if (platformTaskFactory == null) throw new ArgumentNullException("platformTaskFactory");
            if (statistics == null) throw new ArgumentNullException("statistics");
            _platformTaskFactory = platformTaskFactory;
            _statistics = statistics;

            RateCommand = new RelayCommand(_ => ShowRateTask());
            _statistics.PublishAboutLoaded();
        }
Exemplo n.º 2
0
 public ViewCardViewModel([NotNull] INavigationService navigation, [NotNull] BaseCardProvider cardProvider,
     [NotNull] ISecondaryTileService secondaryTileService,
     [NotNull] StatisticsService statistics, From from, 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");
     _navigation = navigation;
     _secondaryTileService = secondaryTileService;
     _statistics = statistics;
     Card = cardProvider.GetById(id).ToViewModel();
     _statistics.PublishViewCardPageLoaded(from == From.Tile);
 }
Exemplo n.º 3
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.º 4
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.º 5
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.º 6
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.º 7
0
 public BackupViewModel([NotNull] ISystemDispatcher dispatcher, [NotNull] StatisticsService statistics)
     : base(dispatcher)
 {
     if (statistics == null) throw new ArgumentNullException("statistics");
     _statistics = statistics;
 }