Soenneker.Blazor.Utils.InteropEventListener 4.0.4073

Prefix Reserved
There is a newer version of this package available.
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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Soenneker.Blazor.Utils.InteropEventListener" Version="4.0.4073" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Blazor.Utils.InteropEventListener" Version="4.0.4073" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Blazor.Utils.InteropEventListener" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Soenneker.Blazor.Utils.InteropEventListener --version 4.0.4073
                    
#r "nuget: Soenneker.Blazor.Utils.InteropEventListener, 4.0.4073"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Soenneker.Blazor.Utils.InteropEventListener@4.0.4073
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Soenneker.Blazor.Utils.InteropEventListener&version=4.0.4073
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Blazor.Utils.InteropEventListener&version=4.0.4073
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
Loading failed

Update dependency Soenneker.Blazor.Utils.BlazorOutputInvoker to 4.0.1015 (#4629)