Soenneker.Blazor.Utils.InteropEventListener
4.0.4073
Prefix Reserved
See the version list below for details.
dotnet add package Soenneker.Blazor.Utils.InteropEventListener --version 4.0.4073
NuGet\Install-Package Soenneker.Blazor.Utils.InteropEventListener -Version 4.0.4073
<PackageReference Include="Soenneker.Blazor.Utils.InteropEventListener" Version="4.0.4073" />
<PackageVersion Include="Soenneker.Blazor.Utils.InteropEventListener" Version="4.0.4073" />
<PackageReference Include="Soenneker.Blazor.Utils.InteropEventListener" />
paket add Soenneker.Blazor.Utils.InteropEventListener --version 4.0.4073
#r "nuget: Soenneker.Blazor.Utils.InteropEventListener, 4.0.4073"
#:package Soenneker.Blazor.Utils.InteropEventListener@4.0.4073
#addin nuget:?package=Soenneker.Blazor.Utils.InteropEventListener&version=4.0.4073
#tool nuget:?package=Soenneker.Blazor.Utils.InteropEventListener&version=4.0.4073
Soenneker.Blazor.Utils.InteropEventListener
Manages the registration, removal, and disposal of .NET object references used for interop event listeners. Handles warnings for potential duplicate registrations and providing methods for cleanup. The class is equipped with asynchronous disposal as well as methods for adding event listeners with generic callback functions.
Install
dotnet add package Soenneker.Blazor.Utils.InteropEventListener
Quick start
using Soenneker.Blazor.Utils.InteropEventListener.Registrars;
using Microsoft.Extensions.DependencyInjection;
var services = new ServiceCollection();
var result = services.AddInteropEventListenerAsScoped();
Adds IInteropEventListener as a scoped service.
What you get
IInteropEventListener— Manages the registration, removal, and disposal of .NET object references used for interop event listeners. Handles warnings for potential duplicate registrations and providing methods for cleanup. The class is equipped with asynchronous disposal as well as methods for adding event listeners with generic callback functions.InteropEventListenerRegistrar— Manages the registration, removal, and disposal of .NET object references used for interop event listeners.
API at a glance
| API | What it does | Result / important behavior |
|---|---|---|
IInteropEventListener.Initialize(eventListeningInterop) |
Initializes a component with the specified interop implementation. | Returns no value; the requested change is complete when the method returns. |
IInteropEventListener.Add(functionName, elementId, eventName, callback, cancellationToken) |
Adds an event listener to a specified HTML element. | A task that completes when the add operation is complete. |
IInteropEventListener.Remove(elementId, eventName) |
Removes an event listener from a specified HTML element by name. | Returns no value; the requested change is complete when the method returns. |
IInteropEventListener.DisposeForElement(elementId) |
Should be called whenever the component that has registered events is disposed. | Returns no value; the requested change is complete when the method returns. |
InteropEventListenerRegistrar.AddInteropEventListenerAsScoped(services) |
Adds IInteropEventListener as a scoped service. |
The same service collection, so additional registrations can be chained. |
Important behavior
IInteropEventListener.Add(functionName, elementId, eventName, callback, cancellationToken): If the event listener is already added for the specified element and event, this method returns a completed task without re-registering.
Practical notes
- Cancellation stops pending work; it does not undo work that has already completed.
- Dispose instances you own when their scope ends so held resources can be released.
| 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
- Soenneker.Blazor.Utils.BlazorInvoker (>= 4.0.1047)
- Soenneker.Blazor.Utils.BlazorOutputInvoker (>= 4.0.1015)
- Soenneker.Blazor.Utils.EventListeningInterop (>= 4.0.1140)
- Soenneker.Extensions.Object (>= 4.0.4302)
NuGet packages (6)
Showing the top 5 NuGet packages that depend on Soenneker.Blazor.Utils.InteropEventListener:
| Package | Downloads |
|---|---|
|
Soenneker.Blazor.TomSelect
A Blazor interop library for the select user control library, Tom Select |
|
|
Soenneker.Blazor.FilePond
A Blazor interop library for the file upload library FilePond |
|
|
Soenneker.Blazor.DataTables
A Blazor interop library for DataTables |
|
|
Soenneker.Blazor.Stripe.Elements
A modular, strongly-typed Blazor library for Stripe Elements |
|
|
Soenneker.Telnyx.Blazor.WebRtc
Blazor interop library for the Telnyx WebRTC client, providing full access to Telnyx's browser-based voice and video calling features. Includes typed wrappers, event bridging, and support for advanced call control in Blazor WebAssembly apps. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.4085 | 0 | 8/31/2026 |
| 4.0.4084 | 0 | 8/31/2026 |
| 4.0.4083 | 0 | 8/31/2026 |
| 4.0.4082 | 79 | 8/31/2026 |
| 4.0.4081 | 273 | 8/30/2026 |
| 4.0.4079 | 140 | 8/30/2026 |
| 4.0.4078 | 82 | 8/30/2026 |
| 4.0.4076 | 221 | 8/30/2026 |
| 4.0.4075 | 39 | 8/30/2026 |
| 4.0.4074 | 39 | 8/30/2026 |
| 4.0.4073 | 77 | 8/29/2026 |
| 4.0.4071 | 82 | 8/29/2026 |
| 4.0.4070 | 40 | 8/29/2026 |
| 4.0.4069 | 37 | 8/29/2026 |
| 4.0.4068 | 680 | 8/26/2026 |
| 4.0.4067 | 193 | 8/26/2026 |
| 4.0.4066 | 209 | 8/26/2026 |
| 4.0.4065 | 158 | 8/25/2026 |
| 4.0.4064 | 319 | 8/22/2026 |
| 4.0.4063 | 223 | 8/22/2026 |
Update dependency Soenneker.Blazor.Utils.BlazorOutputInvoker to 4.0.1015 (#4629)