public void StartListening() { _observable = _eventAggregator.GetEvent <ConnectionChangedEvent>().Subscribe(ConnectionChanged); _themeObs = Observable .FromEvent <ThemeChangedEventHandler, ThemeChangedEventArgs>(handler => VSColorTheme.ThemeChanged += handler, handler => VSColorTheme.ThemeChanged -= handler) .Subscribe(args => { CurrentTheme = ConvertToTheme(VSHelpers.DetectTheme()); _eventAggregator.Publish(new ThemeChangedEvent(CurrentTheme)); }); }
private void OnConnectionChanged(ConnectionData connectionData) { _eventAggregator.Publish(new ConnectionChangedEvent(connectionData)); }
public void ExecuteCommandWithConfirmation(string title, string message, ICommand command) { var ev = new ShowConfirmationEvent(title, message, command); _eventAggregator.Publish(ev); }
public void HandleKeyPress(IConnectionServiceBase connectionService, char key) { _eventAggregatorService.Publish <StateTransitionEventArgs>(new StateTransitionEventArgs(ConnectionState.Connected)); }
public void MoveToState(IConnectionService connectionService, ConnectionState desiredState) { // Publish an event to the event aggregator. If the controller has subscribed to the aggregator it will be called. _eventAggregatorService.Publish <StateTransitionEventArgs>(new StateTransitionEventArgs(desiredState)); }