public MainWindowViewModel(IControlsService controlsService, IObserver1 observer1, IObserver2 observer2)
        {
            _controlsService = controlsService;
            _observer1       = new Observer1("name1");
            _observer2       = new Observer2("name2");

            SwitchCommnad   = new DelegateCommand(OnSwitchCommand);
            ObserverCommand = new DelegateCommand(OnObserverCommand);

            InitProgram();
        }
示例#2
0
 public void Register(IObserver2 observer)
 {
     container.Add(observer);
 }
 public void Detach(IObserver2 observer)
 {
     _observers.Remove(observer);
 }
示例#4
0
 public void UnRegister(IObserver2 observer)
 {
     container.Remove(observer);
 }
 public void Attach(IObserver2 observer)
 {
     _observers.Add(observer);
 }