https://github.com/tbertuzzi/bertuzzi.maui.eventaggregator
⚙️EventAggregator provides multicast publish/subscribe functionality
https://github.com/tbertuzzi/bertuzzi.maui.eventaggregator
event eventaggregator maui maui-apps messagecenter
Last synced: about 1 month ago
JSON representation
⚙️EventAggregator provides multicast publish/subscribe functionality
- Host: GitHub
- URL: https://github.com/tbertuzzi/bertuzzi.maui.eventaggregator
- Owner: TBertuzzi
- Created: 2022-08-18T13:12:27.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-08-19T14:04:20.000Z (about 3 years ago)
- Last Synced: 2025-07-28T05:34:04.091Z (2 months ago)
- Topics: event, eventaggregator, maui, maui-apps, messagecenter
- Language: C#
- Homepage:
- Size: 927 KB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Bertuzzi.MAUI.EventAggregator
The EventAggregator provides multicast publish/subscribe functionality. This means there can be multiple publishers that raise the same event and there can be multiple subscribers listening to the same event.
###### This is the component, works on iOS, Android and UWP.


**NuGet**
|Name|Info|
| ------------------- | :------------------: |
|Bertuzzi.MAUI.EventAggregator|[](https://www.nuget.org/packages/Bertuzzi.MAUI.EventAggregator/)|*Platform Support**
Bertuzzi.MAUI.EventAggregator is a MAUI library.
## Setup / Usage
Does not require additional configuration. Just install the package in the shared project and use.
**Sample**
Create a Sample Message
```csharp
public class TextMessage
{
public string Text { get; set; }
}
```Register Handler to listen to the event
```csharp
private void TextHandler(
TextMessage message)
{
Text = message.Text;
}
//Register Event Handler
EventAggregator.Instance.RegisterHandler(
TextHandler);
```Send Message
```csharp
//Register Event
EventAggregator.Instance.SendMessage(TextMessage);
```The complete example can be downloaded here:
BaseViewModel and Commands used of : https://github.com/jamesmontemagno/mvvm-helpers/tree/master/MvvmHelpers
Based on my package : https://github.com/TBertuzzi/Xamarin.Forms.EventAggregator