Skip to main content
net8.0-windows

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

Published
Jan 1, 1900
128y ago
Total Downloads
7.8K
7,787

Install

dotnet add package DevExpress.AIIntegration.Wpf.Chat --version 26.1.5-pre-26248
ProductVersions
.NET
net8.0-windows

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-windows only. AIChatControl uses 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-windows only. AIChatControl renders 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 UseStreaming to display tokens as they are generated.

  • Markdown-Aware Output Pipeline: The ContentFormat property allows you to render responses in Markdown format, and the MarkdownConvert event provides a conversion hook.

  • Real-Time Streaming Responses: For a smoother chat experience, activate UseStreaming to display tokens as they are generated.

  • File Attachments with Policy Controls: Use FileUploadEnabled to allow users to attach documents and images, and use FileUploadSettings to configure allowed file types and limits.

  • Markdown-Aware Output Pipeline: The ContentFormat property can switch response render mode to Markdown, and the MarkdownConvert event provides a conversion hook.

  • File Attachments with Policy Controls: Specify FileUploadEnabled to allow users to attach documents and images and use FileUploadSettings to configure allowed file types and limits.

  • Message Lifecycle Extensibility: Handle the Initialized event to run code once the chat is ready. The MessageSending event allows you to add system prompts, validate input, redact sensitive content, or cancel delivery. Handle ResponseReceived to 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. The ChatAppearance.AppearanceResources attached property and ChatColorKey resource keys apply a complete appearance override.

  • Conversation and Context Management: ChatResources provides external resources for the conversation, and ResourceItemTemplate customizes their appearance. IncludeFunctionCallInfo and FunctionCallInfoContentTemplate display tool-call details. ChatClientServiceKey and ChatResponseProviderServiceKey switch between multiple registered chat services.

  • Message Lifecycle Extensibility: Handle the Initialized event to run code once the chat is ready. The MessageSending event allows you to add system prompts, validate input, redact sensitive content, or cancel delivery. Handle ResponseReceived to post-process a reply.

  • Programmatic Control: SendMessageAsync, AppendMessageAsync, LoadMessages, CancelRequest, ShowLoadingIndicatorAsync, and HideLoadingIndicatorAsync drive the conversation from code.

  • Conversation and Context Management: ChatResources and ResourceItemTemplate attach external resources to a conversation. IncludeFunctionCallInfo and FunctionCallInfoContentTemplate display tool-call details. ChatClientServiceKey and ChatResponseProviderServiceKey switch 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.

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

No structural changes between v26.1.6-pre-26277 and v26.1.5-pre-26248.

Adoption Assessment

A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.

This version is marked prerelease. Validate its API and upgrade path before production use.No SPDX license expression is published. Review the license text and your organisation's policy before redistribution.Compatibility metadata lists 1 target framework; confirm the exact target used by your application.This version is unlisted. Prefer a listed release unless you deliberately need this exact version for reproducibility.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.