diff --git a/README.md b/README.md index 3c3abfd..a6b551a 100644 --- a/README.md +++ b/README.md @@ -134,6 +134,20 @@ public event EventHandler CanExecuteChanged public void RaiseCanExecuteChanged() => _weakEventManager.HandleEvent(this, EventArgs.Empty, nameof(CanExecuteChanged)); ``` +- `WeakEventManager` + +```csharp +readonly WeakEventManager _errorOcurredEventManager = new WeakEventManager(); + +public event EventHandler ErrorOcurred +{ + add => _errorOcurredEventManager.AddEventHandler(value); + remove => _errorOcurredEventManager.RemoveEventHandler(value); +} + +public void RaiseErrorOcurred(string message) => _weakEventManager.HandleEvent(this, message, nameof(ErrorOcurred)); +``` + ## AsyncAwaitBestPractices.MVVM Allows for `Task` to safely be used asynchronously with `ICommand`: