DevExpress.AIIntegration.Wpf.Chat
Target Platform/Framework: Cross-Platform DevExpress Product Libraries Used: DevExpress AI-powered Extensions for OpenAI, Azure, Ollama, Semantic Kernel (https://www.devexpress.com/ai) Available in the following DevExpress Subscription(s): Universal, DXperience, WPF, Reporting
Install
| Product | Versions |
|---|---|
| .NET |
README
DevExpress WPF AI Chat Control
DevExpress.AIIntegration.Wpf.Chat contains DevExpress WPF AI Chat Control and supporting classes. AIChatControl embeds an interactive, Copilot-inspired chat UI in your WPF application.
NOTE: This package targets
net8.0-windowsonly.AIChatControluses Blazor WebView to render its UI, so the control is unavailable in applications that target .NET Framework. Other DevExpress AI packages, such as DevExpress.AIIntegration.Wpf, support .NET Framework 4.7.2 and later.
NOTE: This package targets
net8.0-windowsonly.AIChatControlrenders its UI in a Blazor WebView, so the control is unavailable in applications that target .NET Framework. Other DevExpress AI packages, such as DevExpress.AIIntegration.Wpf, support .NET Framework 4.7.2 and later.
Key Features
Real-Time Streaming Responses: Activate
UseStreamingto display tokens as they are generated.Markdown-Aware Output Pipeline: The
ContentFormatproperty allows you to render responses in Markdown format, and theMarkdownConvertevent provides a conversion hook.Real-Time Streaming Responses: For a smoother chat experience, activate
UseStreamingto display tokens as they are generated.File Attachments with Policy Controls: Use
FileUploadEnabledto allow users to attach documents and images, and useFileUploadSettingsto configure allowed file types and limits.Markdown-Aware Output Pipeline: The
ContentFormatproperty can switch response render mode to Markdown, and theMarkdownConvertevent provides a conversion hook.File Attachments with Policy Controls: Specify
FileUploadEnabledto allow users to attach documents and images and useFileUploadSettingsto configure allowed file types and limits.Message Lifecycle Extensibility: Handle the
Initializedevent to run code once the chat is ready. TheMessageSendingevent allows you to add system prompts, validate input, redact sensitive content, or cancel delivery. HandleResponseReceivedto inspect or modify a response before the chat UI displays it.Advanced UI Customization:
MessageTemplate,MessageContentTemplate,HeaderText,ShowHeader,CornerRadius, and the message color properties (UserMessageBackground,UserMessageForeground,AssistantMessageBackground,ErrorMessageBackground,InputBackground,InputForeground) adjust the chat appearance. TheChatAppearance.AppearanceResourcesattached property andChatColorKeyresource keys apply a complete appearance override.Conversation and Context Management:
ChatResourcesprovides external resources for the conversation, andResourceItemTemplatecustomizes their appearance.IncludeFunctionCallInfoandFunctionCallInfoContentTemplatedisplay tool-call details.ChatClientServiceKeyandChatResponseProviderServiceKeyswitch between multiple registered chat services.Message Lifecycle Extensibility: Handle the
Initializedevent to run code once the chat is ready. TheMessageSendingevent allows you to add system prompts, validate input, redact sensitive content, or cancel delivery. HandleResponseReceivedto post-process a reply.Programmatic Control:
SendMessageAsync,AppendMessageAsync,LoadMessages,CancelRequest,ShowLoadingIndicatorAsync, andHideLoadingIndicatorAsyncdrive the conversation from code.Conversation and Context Management:
ChatResourcesandResourceItemTemplateattach external resources to a conversation.IncludeFunctionCallInfoandFunctionCallInfoContentTemplatedisplay tool-call details.ChatClientServiceKeyandChatResponseProviderServiceKeyswitch between multiple registered chat services.
Examples
Register an AI Service
Register a chat client at application startup:
using Azure.AI.OpenAI;
using DevExpress.AIIntegration;
using Microsoft.Extensions.AI;
using System;
using System.ClientModel;
using System.Windows;
namespace MyApplication {
public partial class App : Application {
static App() {
IChatClient chatClient = new AzureOpenAIClient(
new Uri("YOUR_AZURE_OPENAI_ENDPOINT"),
new ApiKeyCredential("YOUR_OPENAI_API_KEY"))
.GetChatClient("YOUR_MODEL_NAME").AsIChatClient();
AIExtensionsContainerDesktop.Default.RegisterChatClient(chatClient);
}
}
}
Add a Chat Control
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dxaichat="http://schemas.devexpress.com/winfx/2008/xaml/aichat">
<dxaichat:AIChatControl UseStreaming="True"
ShowHeader="True"
HeaderText="Assistant"
InputBoxNullText="Ask a question..."
FileUploadEnabled="True" />
</Window>
In this configuration, the control behaves as follows:
- Displays responses token by token as the model generates them
- Shows a header above the conversation
- Lets users attach files to a message
Demos
NOTE: Demo links below only work if you already have DevExpress WPF Demos installed on your machine. To install demos, download and run the DevExpress Unified Installer (evaluation or licensed version). Remember to select "Demo Applications" on the product selection screen.
- DevExpress WPF AI Chat Control - Prompt Suggestions
- DevExpress WPF AI Chat Control - File Attachments
- DevExpress WPF AI Chat Control - Resources
- DevExpress WPF AI Chat Control - Customize Appearance
Documentation
Evaluation Period, Pricing Options, and Licensing Terms
Whether you own a license or want to start a 30-day evaluation, download and register your DevExpress license key. To obtain the key, sign in to the DevExpress Download Manager with your existing DevExpress.com account or create a free account. For instructions on key registration, see License Key for DevExpress Products.
If you purchase a license after evaluating a product, you need to re-register your updated DevExpress license key to remove evaluation warnings and messages.
This package is included in the following commercial subscriptions:
See DevExpress Subscriptions & Licensing for subscription comparison tables, purchasing FAQ, and licensing information.
Related Components/Packages
DevExpress.AIIntegration.Wpf - DevExpress AI-powered extensions (behaviors) for WPF controls.
dotnet add package DevExpress.AIIntegration.Wpf
DevExpress.AIIntegration.Wpf.Reporting - AI-powered extensions for the WPF Report Designer.
dotnet add package DevExpress.AIIntegration.Wpf.Reporting
Software Bill of Materials (SBOM)
For information about SBOM files for DevExpress packages, see Software Bill of Materials (SBOM) for DevExpress .NET assemblies/NuGet packages, JavaScript, VCL and other redistributable artifacts.
See Also: Information Security | Security - What You Need to Know
Useful Online Resources
Changes from Previous Version
Adoption Assessment
A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.