AIChatControl.ShowLoadingIndicatorAsync(String) Method
Displays a loading indicator in the chat message area.
Namespace: DevExpress.AIIntegration.WinForms.Chat
Assembly: DevExpress.AIIntegration.WinForms.Chat.v26.1.dll
NuGet Package: DevExpress.AIIntegration.WinForms.Chat
Declaration
Optional Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| message | String | null | The text displayed next to the loading indicator. If |
Returns
| Type | Description |
|---|---|
| Task | A task that completes when the loading indicator appears. |
Remarks
Use the following methods to display a loading indicator while the application performs a long-running operation, such as preparation of additional context before a request to the AI service:
ShowLoadingIndicatorAsync(String)- Displays the loading indicator with an optional caption.- HideLoadingIndicatorAsync() - Hides the loading indicator.
Example
The following example displays the indicator with a custom caption when a user sends a message, and hides the indicator after the operation completes:
using DevExpress.AIIntegration.Blazor.Chat.WebView;
async void AiChatControl1_MessageSending(object sender, AIChatControlMessageSendingEventArgs e) {
await e.Chat.ShowLoadingIndicatorAsync("Fetching additional context...");
// Perform a long-running operation (load data, call an external API, etc.).
await Task.Delay(2000);
await e.Chat.HideLoadingIndicatorAsync();
}
Refer to the following help topic for additional information: AI Chat Control