Soenneker.Blazor.Extensions.EventCallback
11.0.477
Prefix Reserved
dotnet add package Soenneker.Blazor.Extensions.EventCallback --version 11.0.477
NuGet\Install-Package Soenneker.Blazor.Extensions.EventCallback -Version 11.0.477
<PackageReference Include="Soenneker.Blazor.Extensions.EventCallback" Version="11.0.477" />
<PackageVersion Include="Soenneker.Blazor.Extensions.EventCallback" Version="11.0.477" />
<PackageReference Include="Soenneker.Blazor.Extensions.EventCallback" />
paket add Soenneker.Blazor.Extensions.EventCallback --version 11.0.477
#r "nuget: Soenneker.Blazor.Extensions.EventCallback, 11.0.477"
#:package Soenneker.Blazor.Extensions.EventCallback@11.0.477
#addin nuget:?package=Soenneker.Blazor.Extensions.EventCallback&version=11.0.477
#tool nuget:?package=Soenneker.Blazor.Extensions.EventCallback&version=11.0.477
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)
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.477 | 2,175 | 11/18/2026 |
| 11.0.476 | 7,971 | 11/11/2026 |
| 11.0.475 | 555 | 11/10/2026 |
| 11.0.474 | 11,222 | 10/26/2026 |
| 4.0.473 | 912 | 10/25/2026 |
| 4.0.472 | 7,714 | 10/14/2026 |
| 4.0.471 | 572 | 10/14/2026 |
| 4.0.470 | 108 | 10/14/2026 |
| 4.0.465 | 1,093 | 10/12/2026 |
| 4.0.464 | 1,447 | 10/12/2026 |
| 4.0.463 | 1,929 | 10/11/2026 |
| 4.0.462 | 14,178 | 9/24/2026 |
| 4.0.461 | 5,612 | 9/15/2026 |
| 4.0.460 | 5,501 | 9/12/2026 |
| 4.0.459 | 3,236 | 9/8/2026 |
| 4.0.458 | 12,634 | 8/29/2026 |
| 4.0.457 | 277 | 8/29/2026 |
| 4.0.456 | 9,376 | 8/11/2026 |
| 4.0.455 | 10,311 | 7/27/2026 |
| 4.0.454 | 11,139 | 7/16/2026 |
Configure .NET CI defaults and daily source scans