I implemented a derived class of InputFile for handling the cancel event (see also #58118).
I had to use reflection to dispose _jsCallbacksRelay. InputFile should implement the dispose pattern to make it easier for derived classes to properly dispose of resources.