/// <summary> /// Raises the <see cref="CanExecuteChanged"/> event for any listeners still alive, /// and removes any references to garbage collected listeners. /// </summary> public void RaiseCanExecuteChanged() { foreach (var canExecuteChanged in _canExecuteChanged.GetLiveItems()) { canExecuteChanged(_sender, EventArgs.Empty); } }
protected virtual void OnFoo(FooEventArgs args) { lock (_foo) { foreach (var foo in _foo.GetLiveItems()) { foo(this, args); } } }