A button that fills a form model from the text in the clipboard with the help of an AI model. Reads the clipboard, asks the IChatClient configured for IAIChatService to extract the public properties of TModel from it and assigns the values. Put it inside a RadzenTemplateForm<T> bound to the same model.
IComponent
IHandleEvent
IHandleAfterRender
RadzenComponent.GetIdAttribute
RadzenComponent.SetParametersAsync
RadzenComponent.OnAfterRenderAsync
RadzenComponent.RaiseContextMenu
RadzenComponent.RaiseMouseEnter
RadzenComponent.AddContextMenu
RadzenComponent.RaiseMouseLeave
RadzenComponent.OnBecameInvisible
RadzenComponent.DefaultCulture
RadzenComponent.DefaultUICulture
RadzenComponent.IsJSRuntimeAvailable
ComponentBase.OnInitializedAsync
ComponentBase.OnParametersSet
ComponentBase.OnParametersSetAsync
ComponentBase.StateHasChanged
ComponentBase.ShouldRender
ComponentBase.OnAfterRender
ComponentBase.InvokeAsync
ComponentBase.DispatchExceptionAsync
ComponentBase.RendererInfo
ComponentBase.Assets
ComponentBase.AssignedRenderMode
Namespace: Radzen.Blazor
Assembly: Radzen.Blazor.dll
public class RadzenSmartPasteButton<TModel> : RadzenComponent, IComponent, IHandleEvent, IHandleAfterRender| Name | Description |
|---|---|
| TModel | The type of the form model. |
<RadzenTemplateForm Data="@customer">
<RadzenSmartPasteButton Data="@customer" Pasted="@(c => StateHasChanged())" />
...
</RadzenTemplateForm>A button that fills a form model from the text in the clipboard with the help of an AI model. Reads the clipboard, asks the IChatClient configured for IAIChatService to extract the public properties of TModel from it and assigns the values. Put it inside a RadzenTemplateForm<T> bound to the same model.
public RadzenSmartPasteButton<TModel>()Gets or sets the text shown while the model is working.
public string BusyText { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the text shown while the model is working. |
Gets or sets the button style.
public ButtonStyle ButtonStyle { get; set; }
| Type | Description |
|---|---|
| ButtonStyle | Gets or sets the button style. |
Gets or sets the model to fill. Required.
public TModel Data { get; set; }
| Type | Description |
|---|---|
| TModel | Gets or sets the model to fill. Required. |
Gets or sets whether the button is disabled.
public bool Disabled { get; set; }
| Type | Description |
|---|---|
| bool | Gets or sets whether the button is disabled. |
Event callback that is invoked when the clipboard is empty or cannot be read.
public EventCallback EmptyClipboard { get; set; }
| Type | Description |
|---|---|
| EventCallback | Event callback that is invoked when the clipboard is empty or cannot be read. |
Event callback that is invoked when the model request fails.
public EventCallback<Exception> Error { get; set; }
| Type | Description |
|---|---|
| EventCallback<Exception> | Event callback that is invoked when the model request fails. |
Gets or sets the names of the properties to fill. All public writable properties of simple types are filled when not set.
public IEnumerable<string> Fields { get; set; }
| Type | Description |
|---|---|
| IEnumerable<string> | Gets or sets the names of the properties to fill. All public writable properties of simple types are filled when not set. |
Gets or sets the icon. Default is content_paste_go.
public string Icon { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the icon. Default is content_paste_go. |
Gets or sets the icon color.
public string IconColor { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the icon color. |
Gets or sets additional instructions for the model, for example the expected language or format of a field.
public string Instructions { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets additional instructions for the model, for example the expected language or format of a field. |
Gets whether a paste is in progress.
public bool IsBusy { get; }
| Type | Description |
|---|---|
| bool | Gets whether a paste is in progress. |
Gets or sets the model name. Falls back to the configured Model.
public string ModelId { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the model name. Falls back to the configured Model. |
Event callback that is invoked after the model is filled. Receives Data.
public EventCallback<TModel> Pasted { get; set; }
| Type | Description |
|---|---|
| EventCallback<TModel> | Event callback that is invoked after the model is filled. Receives Data. |
Gets or sets the button shade.
public Shade Shade { get; set; }
| Type | Description |
|---|---|
| Shade | Gets or sets the button shade. |
Gets or sets the button size.
public ButtonSize Size { get; set; }
| Type | Description |
|---|---|
| ButtonSize | Gets or sets the button size. |
Gets or sets the button text. Default is Smart paste.
public string Text { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the button text. Default is Smart paste. |
Gets or sets the button title (tooltip).
public string Title { get; set; }
| Type | Description |
|---|---|
| string | Gets or sets the button title (tooltip). |
Gets or sets the button variant.
public Variant Variant { get; set; }
| Type | Description |
|---|---|
| Variant | Gets or sets the button variant. |
protected override void BuildRenderTree(Rendering.RenderTreeBuilder __builder)
| Type | Name | Description |
|---|---|---|
| Rendering.RenderTreeBuilder | __builder |
protected override string GetComponentCssClass()
| Type | Description |
|---|---|
| string |
Fills Data from the specified text instead of the clipboard.
public Task Paste(string text)
| Type | Name | Description |
|---|---|---|
| string | text | The text to extract the field values from. |
| Type | Description |
|---|---|
| Task |