You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that events in custom components can only be registered from the parent component if ParameterAttribute is present. I have followed the example of @danroth27, which is described here: #5504
My custom component:
<input type="text" value="@Value" onchange="@OnInputChanged"/>
@functions
{[Parameter]string Value {get;set;}
public Action<string> ValueChanged {get;set;}void OnInputChanged(UIChangeEventArgse){
Value = e.Value.ToString();
ValueChanged(Value);}}
Upgrade an existing project to Blazor 0.3.0
To upgrade an existing Blazor project from 0.2.0 to 0.3.0:
[..]
Update component parameters to not be public and to add the [Parameter] attribute.
I noticed that events in custom components can only be registered from the parent component if ParameterAttribute is present. I have followed the example of @danroth27, which is described here: #5504
My custom component:
My parent component:
Output: "Cannot convert method group 'OnValueChanged' to non-delegate type 'object'. Did you intend to invoke the method?"
If I add [Parameter] to my event, everything works fine.
The text was updated successfully, but these errors were encountered: