This is the sample to disclose the issue in type casting.
-
Having a method as intermediatory between JS and Blazor
EventCallback<T>
method. which helps to cast the argument and send the argument with proper type to user application mapped event handler. -
So, we have used
makeGenericMethod
option in Asp.net, to convert the normal method to Generic method with its proper type. but here, possible way isinvoke
not aninvokeAsync
since it isAction<T>
. -
Due to this, we unable to process the data in event handler and return back to JS end appropriately since a sync action is happend intermediately.
-
How to cast the
EventCallback<T>
without knowing it T type statically but having it as variable storage and then invoke the function handler. -
We used Task run to trigger the Generic invoke method. but error throws from blazor stated that
Current thread is differ than ui-rendered thread
fromstateHasChanged
method.
- I expect the textbox value to be changed when a change event triggered from textbox as
this is after async method call
but it is asthis is before async method call
.