What Changed
In previous versions, all Upload component events used JSInterop and had the Action<…> type.
In v22.1, the events have the EventCallback<…> type. We also removed the oldFileInfo and newFileInfo arguments of the FileReloaded event. Use the FileReloadedEventArgs class instead.
Reasons for Change
We removed JSInterop from implementation. The Upload component uses custom events to communicate with the server. This change allows you to use the component’s events asynchronously and prevent the UI from being blocked when events fire.
Impact on Existing Apps
This change affects your application if it uses DxUpload events.
How to Update Existing Apps
If you want to use a synchronous event handler, no changes are required. If you want to use an asynchronous event handler, change the event handler signature to an asynchronous one:
Razor// Synchronous SelectedFileChanged event handler protected void SelectedFilesChanged{ //… } // Asynchronous SelectedFileChanged event handler protected async Task SelectedFilesChanged{ //… }
If you handle the FileReloaded event, replace the event arguments with FileReloadedEventArgs:
Razorvoid OnFileReloaded(FileReloadedEventArgs args) { // ... }