DxAIChat.ResourceItemTemplate Property
Specifies a template for an AI resource entry in the resource picker popup.
Namespace: DevExpress.AIIntegration.Blazor.Chat
Assembly: DevExpress.AIIntegration.Blazor.Chat.v25.2.dll
NuGet Package: DevExpress.AIIntegration.Blazor.Chat
Declaration
[Parameter]
public RenderFragment<AIChatResource> ResourceItemTemplate { get; set; }
Property Value
| Type | Description |
|---|---|
| RenderFragment<AIChatResource> | The template content. |
Remarks
Use the ResourceItemTemplate property to customize the layout and appearance of an AI resource entry in the resource picker popup.
The ResourceItemTemplate accepts a AIChatResource object as the context parameter.
The following code snippet adds the AI resource file name to the resource picker entry:
<DxAIChat Resources="Resources">
<ResourceItemTemplate>
<b>@context.Name</b> (@context.Uri)
</ResourceItemTemplate>
</DxAIChat>
@code {
List<AIChatResource> Resources { get; set; } = [];
protected override async Task OnInitializedAsync() {
AIChatResource instructions = await FileResourceProvider.GetTextResourceAsync("instructions",
"Technical Support",
"An assistant that helps troubleshoot technical issues and provides step-by-step solutions.");
AIChatResource documentation = await FileResourceProvider.GetTextResourceAsync("api-reference.md",
"API Reference",
"DevExpress Blazor AI Chat API Reference.");
AIChatResource screenshot = await FileResourceProvider.GetBinaryResourceAsync("ai-chat-image.png",
"AI Chat Screenshot",
"An annotated screenshot of the AI Chat component.",
"image/png");
Resources.Add(instructions);
Resources.Add(documentation);
Resources.Add(screenshot);
await base.OnInitializedAsync();
}
}

See Also