Skip to content

Commit

Permalink
Added WeakEventManager<T>
Browse files Browse the repository at this point in the history
  • Loading branch information
brminnick authored Dec 17, 2018
1 parent 09f1fc8 commit 240b96a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,20 @@ public event EventHandler CanExecuteChanged
public void RaiseCanExecuteChanged() => _weakEventManager.HandleEvent(this, EventArgs.Empty, nameof(CanExecuteChanged));
```

- `WeakEventManager<T>`

```csharp
readonly WeakEventManager<string> _errorOcurredEventManager = new WeakEventManager<string>();

public event EventHandler<string> 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`:
Expand Down

0 comments on commit 240b96a

Please sign in to comment.