mirror of
https://github.com/PacktPublishing/Web-Development-with-Blazor-Second-Edition.git
synced 2026-04-08 07:43:53 +00:00
Initial commit
This commit is contained in:
parent
2190113c56
commit
3088165398
1765 changed files with 192085 additions and 0 deletions
|
|
@ -0,0 +1,22 @@
|
|||
using System.Diagnostics.CodeAnalysis;
|
||||
using Microsoft.AspNetCore.Components.Rendering;
|
||||
namespace Microsoft.AspNetCore.Components.Forms;
|
||||
public class InputTextAreaOnInput :
|
||||
InputBase<string?>
|
||||
{
|
||||
protected override void BuildRenderTree(RenderTreeBuilder builder)
|
||||
{
|
||||
builder.OpenElement(0, "textarea");
|
||||
builder.AddMultipleAttributes(1, AdditionalAttributes);
|
||||
builder.AddAttribute(2, "class", CssClass);
|
||||
builder.AddAttribute(3, "value", BindConverter.FormatValue(CurrentValue));
|
||||
builder.AddAttribute(4, "oninput", EventCallback.Factory.CreateBinder<string?>(this, __value => CurrentValueAsString = __value, CurrentValueAsString));
|
||||
builder.CloseElement();
|
||||
}
|
||||
protected override bool TryParseValueFromString(string? value, out string? result, [NotNullWhen(false)] out string? validationErrorMessage)
|
||||
{
|
||||
result = value;
|
||||
validationErrorMessage = null;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue