Файл CustomInputBase.razor —
Код: Выделить всё
@inherits CustomInputBase
@using System.Linq.Expressions
@if (Type == "number")
{
}
else if (Type == "text")
{
}
Код: Выделить всё
public class CustomInputBase : ComponentBase
{
[Parameter] public string Type { get; set; }
[Parameter] public int IntValue { get; set; }
[Parameter] public EventCallback IntValueChanged { get; set; }
[Parameter] public string StringValue { get; set; }
[Parameter] public EventCallback StringValueChanged { get; set; }
[Parameter] public string Id { get; set; }
[Parameter] public string Class { get; set; } = "form-control";
protected async Task OnIntValueChanged(int newValue)
{
IntValue = newValue;
await IntValueChanged.InvokeAsync(IntValue);
}
protected async Task OnStringValueChanged(string newValue)
{
StringValue = newValue;
await StringValueChanged.InvokeAsync(StringValue);
}
}
Как устранить ошибку?
Подробнее здесь: https://stackoverflow.com/questions/790 ... -eventcall