Soenneker.Blazor.Extensions.EventCallback
11.0.474
Prefix Reserved
dotnet add package Soenneker.Blazor.Extensions.EventCallback --version 11.0.474
NuGet\Install-Package Soenneker.Blazor.Extensions.EventCallback -Version 11.0.474
<PackageReference Include="Soenneker.Blazor.Extensions.EventCallback" Version="11.0.474" />
<PackageVersion Include="Soenneker.Blazor.Extensions.EventCallback" Version="11.0.474" />
<PackageReference Include="Soenneker.Blazor.Extensions.EventCallback" />
paket add Soenneker.Blazor.Extensions.EventCallback --version 11.0.474
#r "nuget: Soenneker.Blazor.Extensions.EventCallback, 11.0.474"
#:package Soenneker.Blazor.Extensions.EventCallback@11.0.474
#addin nuget:?package=Soenneker.Blazor.Extensions.EventCallback&version=11.0.474
#tool nuget:?package=Soenneker.Blazor.Extensions.EventCallback&version=11.0.474
Soenneker.Blazor.Extensions.EventCallback
Small Blazor extensions that invoke an EventCallback only when its consumer assigned a delegate.
Installation
dotnet add package Soenneker.Blazor.Extensions.EventCallback
Usage
The extension removes repeated HasDelegate checks from reusable components:
@using Soenneker.Blazor.Extensions.EventCallback
<button @onclick="Save">Save</button>
@code {
[Parameter]
public EventCallback<Order> OnSaved { get; set; }
private async Task Save()
{
Order order = await SaveOrder();
await OnSaved.InvokeIfHasDelegate(order);
}
}
The non-generic overload works the same way:
[Parameter]
public EventCallback OnClosed { get; set; }
await OnClosed.InvokeIfHasDelegate();
When no delegate is assigned, both overloads return Task.CompletedTask. When a delegate is assigned, invocation follows normal Blazor EventCallback.InvokeAsync behavior, including renderer dispatch and exception propagation. Await the returned task when subsequent work depends on the callback completing.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- Microsoft.AspNetCore.Components (>= 11.0.0-rc.3.26522.148)
NuGet packages (11)
Showing the top 5 NuGet packages that depend on Soenneker.Blazor.Extensions.EventCallback:
| Package | Downloads |
|---|---|
|
Soenneker.Blazor.TomSelect
A Blazor interop library for the select user control library, Tom Select |
|
|
Soenneker.Blazor.Turnstile
Renders a Cloudflare Turnstile widget in Blazor and exposes its token and lifecycle events. |
|
|
Soenneker.Blazor.Stripe.Elements
A modular, strongly-typed Blazor library for Stripe Elements |
|
|
Soenneker.Blazor.Chatwoot
A Blazor interop library for Chatwoot, the open-source customer engagement suite. |
|
|
Soenneker.Blazor.Floating.Tooltips
A Blazor interop library using the modern library, floating-ui, for tooltips |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 11.0.474 | 7,604 | 10/26/2026 |
| 4.0.473 | 905 | 10/25/2026 |
| 4.0.472 | 7,046 | 10/14/2026 |
| 4.0.471 | 569 | 10/14/2026 |
| 4.0.470 | 100 | 10/14/2026 |
| 4.0.465 | 1,090 | 10/12/2026 |
| 4.0.464 | 1,443 | 10/12/2026 |
| 4.0.463 | 1,925 | 10/11/2026 |
| 4.0.462 | 14,162 | 9/24/2026 |
| 4.0.461 | 5,596 | 9/15/2026 |
| 4.0.460 | 5,497 | 9/12/2026 |
| 4.0.459 | 3,235 | 9/8/2026 |
| 4.0.458 | 12,625 | 8/29/2026 |
| 4.0.457 | 276 | 8/29/2026 |
| 4.0.456 | 9,372 | 8/11/2026 |
| 4.0.455 | 10,305 | 7/27/2026 |
| 4.0.454 | 11,134 | 7/16/2026 |
| 4.0.453 | 2,989 | 7/14/2026 |
| 4.0.452 | 12,115 | 6/18/2026 |
| 4.0.451 | 7,502 | 6/9/2026 |
Migrate to .NET 11 and version 11