Soenneker.Blazor.Extensions.EventCallback
4.0.473
Prefix Reserved
See the version list below for details.
dotnet add package Soenneker.Blazor.Extensions.EventCallback --version 4.0.473
NuGet\Install-Package Soenneker.Blazor.Extensions.EventCallback -Version 4.0.473
<PackageReference Include="Soenneker.Blazor.Extensions.EventCallback" Version="4.0.473" />
<PackageVersion Include="Soenneker.Blazor.Extensions.EventCallback" Version="4.0.473" />
<PackageReference Include="Soenneker.Blazor.Extensions.EventCallback" />
paket add Soenneker.Blazor.Extensions.EventCallback --version 4.0.473
#r "nuget: Soenneker.Blazor.Extensions.EventCallback, 4.0.473"
#:package Soenneker.Blazor.Extensions.EventCallback@4.0.473
#addin nuget:?package=Soenneker.Blazor.Extensions.EventCallback&version=4.0.473
#tool nuget:?package=Soenneker.Blazor.Extensions.EventCallback&version=4.0.473
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 | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Microsoft.AspNetCore.Components (>= 10.0.14)
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 | 8,595 | 10/26/2026 |
| 4.0.473 | 905 | 10/25/2026 |
| 4.0.472 | 7,143 | 10/14/2026 |
| 4.0.471 | 569 | 10/14/2026 |
| 4.0.470 | 101 | 10/14/2026 |
| 4.0.465 | 1,090 | 10/12/2026 |
| 4.0.464 | 1,444 | 10/12/2026 |
| 4.0.463 | 1,925 | 10/11/2026 |
| 4.0.462 | 14,165 | 9/24/2026 |
| 4.0.461 | 5,599 | 9/15/2026 |
| 4.0.460 | 5,497 | 9/12/2026 |
| 4.0.459 | 3,235 | 9/8/2026 |
| 4.0.458 | 12,627 | 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,137 | 7/16/2026 |
| 4.0.453 | 2,990 | 7/14/2026 |
| 4.0.452 | 12,128 | 6/18/2026 |
| 4.0.451 | 7,502 | 6/9/2026 |
Update dependency Microsoft.AspNetCore.Components to 10.0.14 (#1081)