Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Blazor
  3. Blazor.EventAggregator

Blazor.EventAggregator

MITC#

A lightweight event aggregator for Blazor that enables indirect component-to-component communication through publish/subscribe messaging.

GitHubGitHub
122 stars23 forks0 contributors

What is Blazor.EventAggregator?

Blazor.EventAggregator is a lightweight event aggregator library specifically designed for Blazor applications. It implements the publish/subscribe pattern to enable indirect communication between Blazor components, allowing components to broadcast events and other components to react to those events without direct dependencies.

Target Audience

Blazor developers building applications with multiple components that need to communicate without tight coupling, particularly those using server-side Blazor or WebAssembly who need a clean messaging solution.

Value Proposition

Developers choose Blazor.EventAggregator because it provides a proven event aggregator pattern adapted specifically for Blazor, offers simple dependency injection integration, and includes optional automatic state refresh functionality to simplify UI updates.

Overview

Lightweight Event Aggregator for Blazor (Razor Components).

Use Cases

Best For

  • Implementing publish/subscribe messaging between Blazor components
  • Decoupling components in medium to large Blazor applications
  • Handling cross-component communication in server-side Blazor
  • Managing event-driven architectures in Blazor WebAssembly apps
  • Reducing direct dependencies between UI components
  • Building applications where multiple components need to react to the same events

Not Ideal For

  • Blazor projects using pure Razor components without code-behind inheritance
  • Applications needing advanced event features like scoping, filtering, or priority handling
  • Teams requiring extensive ecosystem support or integration with modern state management libraries
  • High-performance scenarios where reflection-based auto-refresh introduces unacceptable overhead

Pros & Cons

Pros

Lightweight and Proven Base

Based on the established Caliburn.Micro event aggregator code, ensuring minimal overhead and reliability from a battle-tested implementation, as noted in the README.

Simple DI Integration

Easy setup with a single line in ConfigureServices (services.AddEventAggregator()) and straightforward injection via IEventAggregator interface, as shown in the publisher and subscriber examples.

Automatic State Refresh

Optional auto-refresh functionality calls StateHasChanged on subscriber components after event handling, reducing the need for manual UI updates, though it relies on reflection.

Code-Behind Pattern Support

Specifically designed to work with Blazor components using inheritance and code-behind patterns, as demonstrated in the full examples for publishers and subscribers.

Cons

Limited Testing and Compatibility

The library has only been tested with server-side Blazor, and while no issues are known for WebAssembly, this lack of thorough testing could lead to unforeseen compatibility problems, as admitted in the README.

Reflection-Dependent Auto-Refresh

Auto-refresh relies on reflection and assumes subscribers inherit from ComponentBase, which limits flexibility for components using alternative patterns and adds performance overhead.

Basic Feature Set

Lacks advanced event handling features such as event filtering, scoping, or built-in error handling, making it less suitable for complex event-driven architectures beyond simple publish/subscribe.

Frequently Asked Questions

Quick Stats

Stars122
Forks23
Contributors0
Open Issues6
Last commit5 years ago
CreatedSince 2019

Tags

#razor-components#publish-subscribe#dependency-injection#csharp#dotnet-core#event-aggregator#component-communication#blazor

Built With

B
Blazor
.
.NET Core
C
C++

Included in

Blazor9.3k
Auto-fetched 12 hours ago

Related Projects

FluxorFluxor

Fluxor is a zero boilerplate Flux/Redux library for Microsoft .NET and Blazor.

Stars1,476
Forks168
Last commit1 month ago
Blazored.LocalStorageBlazored.LocalStorage

A library to provide access to local storage in Blazor applications

Stars1,326
Forks136
Last commit1 year ago
bUnit - a testing library for Blazor componentsbUnit - a testing library for Blazor components

bUnit is a testing library for Blazor components that make tests look, feel, and runs like regular unit tests. bUnit makes it easy to render and control a component under test’s life-cycle, pass parameter and inject services into it, trigger event handlers, and verify the rendered markup from the component using a built-in semantic HTML comparer.

Stars1,305
Forks120
Last commit23 hours ago
Blazor-StateBlazor-State

A Blazor State management library by TimeWarp.

Stars612
Forks57
Last commit15 hours ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub