public MainWindowViewModel(IApplicationMessageEvent applicationMessageEvent, IPomodoro pomodoro) { // setup for ApplicationMessageEvent to communicate with other viewmodels and views Messenger = applicationMessageEvent; Subject += ((IApplicationMessage m) => m.Execute(this)); this.pomodoro = pomodoro; pomodoro.OnSwitchToBreak += new Action(OnSwitchToBreakEvent); pomodoro.OnSwitchToTask += new Action(OnSwitchToTaskEvent); pomodoro.OnSwitchToLongBreak += new Action(OnSwitchToLongBreakEvent); pomodoro.OnCompletePomodoro += new Action(OnCompletePomodoroEvent); tickTimer = new TickTimer(50); tickTimer.OnTick += new Action(OnTick); MainButtonCommand = new StartCommand(this); ConfigButtonCommand = new ConfigButtonCommandImpl(applicationMessageEvent); InitializeBackgroundColor(); }
public ServiceProvider() { configManager = new ConfigManager(); pomodoro = new Pomodoro(); pomodoro.Configure(configManager); }
public void SetUpMainWindowViewModel() { pomodoro = Substitute.For <IPomodoro>(); applicationController = Substitute.For <IApplicationController>(); mainWindowViewModel = new MainWindowViewModel(applicationController, pomodoro); }
public void SetPomodoro(IPomodoro pomodoro) { this.pomodoro = pomodoro; }