Ejemplo n.º 1
0
 public MainViewModel(ICourseRepository courseRepository, IHistoryNavigationService navigationService, IWeekDayService weekDayService)
 {
     _courseRepository  = courseRepository;
     _navigationService = navigationService;
     _weekDayService    = weekDayService;
     _selectedWeekDay   = _weekDayService.GetToday();
 }
Ejemplo n.º 2
0
        public MainViewModel(ISettingsRepository settingsRepository, IBeerRepository beerRepository, IInteractionService interactionService, IDrinkerCycleRepository drinkerCycleRepository, IHistoryNavigationService navigationService, IProgressService progressService)
        {
            _settingsRepository = settingsRepository;
            _beerRepository = beerRepository;
            _interactionService = interactionService;
            _drinkerCycleRepository = drinkerCycleRepository;
            _navigationService = navigationService;
            _progressService = progressService;

            _addBeer = new RelayCommand(AddBeer);
            _removeBeer = new RelayCommand(RemoveBeer, () => CanRemoveBeer);
            _addGroup = new RelayCommand(AddGroup, () => CanAddGroup);

            _refreshCommand = new RelayCommand(Refresh, () => CanRefresh);
            _openSettingsCommand = new RelayCommand(OpenSettings);

            Messenger.Default.Register<Messages>(this, EvaluateMessages);

            if (IsInDesignMode)
            {
                DrinkerCycles = _drinkerCycleRepository.GetSampleCycles();
                UserInformation = settingsRepository.GetSampleUserInformations();
            }
            else
            {
                Initialize();
            }
        }
Ejemplo n.º 3
0
        public SettingsViewModel(ISettingsRepository settingsRepository, IProgressService progressService, IHistoryNavigationService navigationService, IStorageService storageService) :
            base(settingsRepository, storageService)
        {
            _settingsRepository = settingsRepository;
            _progressService = progressService;
            _navigationService = navigationService;

            _saveSettings = new RelayCommand(SaveSettings, () => CanSaveSettings);
        }
Ejemplo n.º 4
0
        public FeedPageViewModel(IArticleRepository articleRepository, IHistoryNavigationService historyNavigationService)
        {
            _articleRepository = articleRepository;
            _historyNavigationService = historyNavigationService;

            if (IsInDesignMode)
            {
                SelectFeed(articleRepository.GetActiveSources()[0].ActiveFeeds[0]);
            }
        }
Ejemplo n.º 5
0
 public LectureViewModel(ICourseRepository courseRepository, IHistoryNavigationService navigationService)
 {
     _courseRepository  = courseRepository;
     _navigationService = navigationService;
     Messenger.Default.Register <Lecture>(this, Messages.Select, SelectLecture);
     if (IsInDesignModeStatic)
     {
         Lecture = courseRepository.GetCoursesLazy().FirstOrDefault().Lectures.FirstOrDefault();
     }
 }
Ejemplo n.º 6
0
        public FeedPageViewModel(IArticleRepository articleRepository, IHistoryNavigationService historyNavigationService)
        {
            _articleRepository        = articleRepository;
            _historyNavigationService = historyNavigationService;

            if (IsInDesignMode)
            {
                SelectFeed(articleRepository.GetActiveSources()[0].ActiveFeeds[0]);
            }
        }
Ejemplo n.º 7
0
 public CourseViewModel(ICourseRepository courseRepository, IHistoryNavigationService navigationService, IInteractionService interactionService, IWeekDayService weekDayService)
 {
     _courseRepository   = courseRepository;
     _navigationService  = navigationService;
     _interactionService = interactionService;
     _weekDayService     = weekDayService;
     Messenger.Default.Register <Course>(this, Messages.Select, SelectCourse);
     if (IsInDesignModeStatic)
     {
         Course = courseRepository.GetCoursesLazy().FirstOrDefault();
     }
 }
Ejemplo n.º 8
0
        public WizardViewModel(IInteractionService interactionService, ISettingsRepository settingsRepository, IStorageService storageService, IHistoryNavigationService navigationService, IProgressService progressService) : 
            base(settingsRepository,storageService)
        {
            _interactionService = interactionService;
            _settingsRepository = settingsRepository;
            _navigationService = navigationService;
            _progressService = progressService;

            _exitWizard = new RelayCommand(ExitWizard, () => CanExitWizard);

            if (!IsInDesignMode)
                InitializeWizard();
        }
Ejemplo n.º 9
0
        public DrinkerCycleViewModel(IDrinkerCycleRepository drinkerCycleRepository, IProgressService progressService, IHistoryNavigationService navigationService)
        {
            _drinkerCycleRepository = drinkerCycleRepository;
            _progressService = progressService;
            _navigationService = navigationService;

            _authDrinker = new RelayCommand<Person>(AuthDrinker, CanAuthenticateDrinker);
            _removeDrinker = new RelayCommand<Person>(RemoveDrinker, CanRemoveDrinker);

            _leaveGroupCommand = new RelayCommand(LeaveGroup);

            if (IsInDesignMode)
            {
                DrinkerCycle = _drinkerCycleRepository.GetSampleCycles()[0];
            }
            Messenger.Default.Register<DrinkerCycle>(this, Messages.Select, SelectDrinkerCycle);
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        public NoteViewModel(INoteRepository noteRepository, IHistoryNavigationService navigationService, IProgressService progressService)
        {
            _noteRepository = noteRepository;
            _navigationService = navigationService;
            _progressService = progressService;
            
            _saveNoteCommand = new LoadingRelayCommand(SaveNote, () => CanSaveNote);
            _removeNoteCommand = new LoadingRelayCommand(RemoveNote);

            _removeNoteCommand.AddDependentCommand(_saveNoteCommand);
            _saveNoteCommand.AddDependentCommand(_removeNoteCommand);

            if (IsInDesignMode)
            {
                ActiveNote = noteRepository.GetCollections()[0].CompletedNotes[0];
            }
        }
Ejemplo n.º 11
0
        public MainPageViewModel(IProgressService progressService, IArticleRepository articleRepository, ISettingsRepository settingsRepository, IHistoryNavigationService historyNavigationService, IDialogService dialogService, IPermissionsService permissionsService)
        {
            _articleRepository        = articleRepository;
            _historyNavigationService = historyNavigationService;
            _permissionsService       = permissionsService;

            _openSettingsCommand  = new RelayCommand(OpenSettings);
            _openInfoCommand      = new RelayCommand(OpenInfo);
            _refreshCommand       = new LoadingRelayCommand(Refresh, () => _canRefresh, true);
            _selectArticleCommand = new RelayCommand <ArticleModel>(SelectArticle);
            _selectFeedCommand    = new RelayCommand <FeedModel>(SelectFeed);

            _permissionsService.PermissionsChanged += PermissionsServiceOnPermissionsChanged;

            Sources = _articleRepository.GetActiveSources();

            if (!IsInDesignMode)
            {
                Initialize();
            }
        }
Ejemplo n.º 12
0
        public MainPageViewModel(IProgressService progressService, IArticleRepository articleRepository, ISettingsRepository settingsRepository, IHistoryNavigationService historyNavigationService, IDialogService dialogService, IPermissionsService permissionsService)
        {
            _articleRepository = articleRepository;
            _historyNavigationService = historyNavigationService;
            _permissionsService = permissionsService;

            _openSettingsCommand = new RelayCommand(OpenSettings);
            _openInfoCommand = new RelayCommand(OpenInfo);
            _refreshCommand = new LoadingRelayCommand(Refresh, () => _canRefresh, true);
            _selectArticleCommand = new RelayCommand<ArticleModel>(SelectArticle);
            _selectFeedCommand = new RelayCommand<FeedModel>(SelectFeed);

            _permissionsService.PermissionsChanged += PermissionsServiceOnPermissionsChanged;

            Sources = _articleRepository.GetActiveSources();

            if (!IsInDesignMode)
            {
                Initialize();
            }
        }
Ejemplo n.º 13
0
        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        public MainViewModel(INoteRepository noteRepository, IProgressService progressService, IHistoryNavigationService navigationService)
        {
            _noteRepository = noteRepository;
            _progressService = progressService;
            _navigationService = navigationService;

            _refreshCommand = new LoadingRelayCommand(Refresh);
            _addNoteCommand = new LoadingRelayCommand(AddNote, () => CanAddNote);
            _removeNote = new LoadingRelayCommand<NoteModel>(RemoveNote);
            _toggleCompleted = new LoadingRelayCommand<NoteModel>(ToggleCompleted);

            NoteCollections = noteRepository.GetCollections();
            NoteCollections.CollectionChanged += NoteCollectionsOnCollectionChanged;
            if (IsInDesignMode)
            {
                ActiveCollection = NoteCollections[0];
            }

            _removeNoteCollection = new LoadingRelayCommand<NoteCollectionModel>(RemoveNoteCollection, CanRemoveNoteCollection);
            _saveNoteCollection = new LoadingRelayCommand<NoteCollectionModel>(SaveNoteCollection, CanSaveNoteCollection);
            _addNoteCollectionCommand = new LoadingRelayCommand(AddNoteCollection, () => CanAddNoteCollection);
            _selectNoteCommand = new RelayCommand<NoteModel>(SelectNote);
        }