public PersistService(IRepository repository, IEventAggregator eventAggregator, CcdLevel currentLevel) { _repository = repository; currentLevel.Advanced += (s, e) => PersistData(null); eventAggregator.GetEvent<AdviceGivenEvent>().Subscribe(PersistData); }
public Navigator(IRegionManager regionManager, IEventAggregator eventAggregator, CcdLevel currentLevel) { _regionManager = regionManager; _currentLevel = currentLevel; eventAggregator.GetEvent<RetrospectiveDoneEvent>().Subscribe(NavigateToShowAdviceView); eventAggregator.GetEvent<AdviceGivenEvent>().Subscribe(o => NavigateToCorrectCcdLevelsView()); currentLevel.Advanced += (s, e) => NavigateToCorrectCcdLevelsView(); }
public HeaderViewModel(IEventAggregator eventAggregator, CcdLevel currentLevel) { _logger.Trace("Wiring events"); _beginRetrospectiveEvent = eventAggregator.GetEvent<BeginRetrospectiveEvent>(); eventAggregator.GetEvent<AdviceGivenEvent>().Subscribe(_ => DeceideIfRetrospectiveIsAvailable(currentLevel)); currentLevel.Advanced += (s, e) => DeceideIfRetrospectiveIsAvailable(currentLevel); DeceideIfRetrospectiveIsAvailable(currentLevel); }
private void Initialize() { Retrospectives = _persister.Load(); var lastRetrospective = Retrospectives.FirstOrDefault(); if (lastRetrospective == null) _currentLevel = new CcdLevel(Level.Black); else _currentLevel = lastRetrospective.Clone(); }
public AdviceViewModel(IEventAggregator eventAggregator, IRepository repository, IRalfWestphal ralfWestphal, CcdLevel currentLevel) { _repository = repository; _ralfWestphal = ralfWestphal; _currentLevel = currentLevel; _logger.Trace("Wiring events"); _adviceGivenEvent = eventAggregator.GetEvent<AdviceGivenEvent>(); QueryRalfWestphal(); }
public CcdLevel Clone() { var clone = new CcdLevel(Level); for (int index = 0; index < Principles.Count; index++) { var principle = Principles[index]; clone.Principles[index].EvaluationValue = principle.EvaluationValue; } for (int index = 0; index < Practices.Count; index++) { var practice = Practices[index]; clone.Practices[index].EvaluationValue = practice.EvaluationValue; } return(clone); }
public CcdLevel Clone() { var clone = new CcdLevel(Level); for (int index = 0; index < Principles.Count; index++) { var principle = Principles[index]; clone.Principles[index].EvaluationValue = principle.EvaluationValue; } for (int index = 0; index < Practices.Count; index++) { var practice = Practices[index]; clone.Practices[index].EvaluationValue = practice.EvaluationValue; } return clone; }
public CcdLevelsViewModel(IEventAggregator eventAggregator, CcdLevel currentLevel) { _currentLevel = currentLevel; _currentLevel.Advanced += (s, e) => { _logger.Trace("Principles and Practices have updated - tell it to the view."); OnPropertyChanged("CurrentLevel"); OnPropertyChanged("Principles"); OnPropertyChanged("Practices"); }; _logger.Trace("Wiring events"); _retrospectiveDoneEvent = eventAggregator.GetEvent<RetrospectiveDoneEvent>(); eventAggregator.GetEvent<BeginRetrospectiveEvent>().Subscribe(x => { _logger.Trace("Let's begin the retrospective - switch to evaluation-mode"); EvaluationVisible = true; }); }
public WhiteLevelViewModel(CcdLevel currentLevel) { _currentLevel = currentLevel; }
private void DeceideIfRetrospectiveIsAvailable(CcdLevel currentLevel) { if (currentLevel.Level != Level.Black && currentLevel.Level != Level.White) RetrospectiveAvailable = true; }
public BlackLevelViewModel(CcdLevel currentLevel) { _currentLevel = currentLevel; }