private void DetachObserver(Button button, BaseObserverView observer) { if (button.Text.Equals("Detach")) { subject.Detach(observer); button.Text = "Attach"; } else { subject.Attach(observer); button.Text = "Detach"; } }
public void Attach(BaseObserverView observer) { observers.Add(observer); }
public void Detach(BaseObserverView observer) { observers.Remove(observer); }