共用方式為


NavigationManager.RegisterLocationChangingHandler 方法

定義

註冊處理常式來處理傳入導覽事件。

public IDisposable RegisterLocationChangingHandler (Func<Microsoft.AspNetCore.Components.Routing.LocationChangingContext,System.Threading.Tasks.ValueTask> locationChangingHandler);
member this.RegisterLocationChangingHandler : Func<Microsoft.AspNetCore.Components.Routing.LocationChangingContext, System.Threading.Tasks.ValueTask> -> IDisposable
Public Function RegisterLocationChangingHandler (locationChangingHandler As Func(Of LocationChangingContext, ValueTask)) As IDisposable

參數

locationChangingHandler
Func<LocationChangingContext,ValueTask>

處理傳入導覽事件的處理常式。

傳回

IDisposable,可處置以取消註冊位置變更處理常式。

適用於