public LayoutService(ISettingsStore store, ILogger logger, ISchedulerProvider schedulerProvider, IObjectProvider objectProvider, IApplicationStateNotifier stateNotifier) { _store = store; _logger = logger; _objectProvider = objectProvider; schedulerProvider.MainThread.Schedule(Restore); stateNotifier.StateChanged.Where(state => state == ApplicationState.ShuttingDown) .Subscribe(_ => { Write(); }); }