界面控件DevExpress WinForms v25.1 - AI聊天控件功能持续增强

DevExpress WinForms拥有180+组件和UI库,能为Windows Forms平台创建具有影响力的业务解决方案。DevExpress WinForms能完美构建流畅、美观且易于使用的应用程序,无论是Office风格的界面,还是分析处理大批量的业务数据,它都能轻松胜任!

DevExpress WinForms控件v25.1日前已经全新发布,新版本全新数据编辑器、AI聊天控件功能增强等,欢迎下载最新版体验!

点击获取DevExpress v25.1正式版下载

数据编辑器
步骤进度条 - UX增强

DevExpress WinForms v25.1版本改进了基于步骤的导航工作流用户体验,在新版本中,用户可以按照如下方式与StepProgressBar项进行交互:

  • 单击某项来选择它。
  • 使用方向键在项目之间移动焦点。
  • 按"Enter"或"Space"键选择一个项目。

新的StepProgressBar API包括:

C#

cs 复制代码
stepProgressBar1.AllowUserInteraction = true;
// ...
void StepProgressBar1_ItemClick(object sender, StepProgressBarItemClickEventArgs e) {
if (IsDataSaved(e.Item)) return;
if (XtraMessageBox.Show("You have unsaved changes. Would you like to save them?", "Warning", MessageBoxButtons.YesNo) == DialogResult.Yes)
e.Handled = true;
}
SearchLookUpEdit - 同步查找面板文本

DevExpress WinForms SearchLookUpEdit允许用户为弹出视图指定查找面板文本,确保与FindFilterText属性同步。之前修改PopupView.FindFilterText属性不会更新查找面板的文本框,从而导致搜索行为不一致,这个增强确保查找面板显示实际应用的过滤器。

C#

cs 复制代码
searchLookUpEdit.Properties.View.FindFilterText = "Mike";
MemoEdit - 布局控件内的自动高度

DevExpress WinForms MemoEdit控件包含了一个新的LayoutControlAutoHeightMode属性,此属性指定当放置在LayoutControl中时,MemoEdit的高度如何调整来适应内容,可用的自动高度模式包括:

  • Default / None - MemoEdit高度保持固定,不随内容调整。如果内容超过可用高度,就会出现滚动条。
  • GrowOnly - MemoEdit的高度增加来适配内容,但在内容减少时不会降低。
  • GrowAndShrink - MemoEdit高度自动增加或减少来适配内容。
CheckedListBoxControl - 自定义SVG检查图标

DevExpress WinForms CheckedListBoxControl现在支持用户定义(自定义)SVG复选图标。在v25.1中,您可以为选中的、未选中的和灰色的项目状态指定唯一的图标。该增强支持自定义,来匹配应用程序主题/UI标准。

C#

cs 复制代码
checkedListBoxControl1.CheckStyle = CheckStyles.UserDefined;
checkedListBoxControl1.ImageOptions.SvgImageChecked = svgImageCollection["checkedState"];
checkedListBoxControl1.ImageOptions.SvgImageUnchecked = svgImageCollection["uncheckedState"];
checkedListBoxControl1.ImageOptions.SvgImageSize = new System.Drawing.Size(16, 16);
TokenEdit - 高级模式

v25.1包含了WinForms TokenEdit的新API,使用这些API,您可以自定义以下高级模式设置:

  • Caret Animation (AllowCaretAnimation)
  • Selection Animation (AllowSelectionAnimation)
  • Selection Color Customization (SelectionColor)

使用TokenEdit.Properties.AdvancedModeOptions属性来访问高级模式设置:

C#

cs 复制代码
// Enable Advanced Mode.
tokenEdit.Properties.UseAdvancedMode = DefaultBoolean.True;
// Enable caret animation.
tokenEdit.Properties.AdvancedModeOptions.AllowCaretAnimation = DefaultBoolean.True;
// Animate selection.
tokenEdit.Properties.AdvancedModeOptions.AllowSelectionAnimation = DefaultBoolean.True;
// Set selection color.
tokenEdit.Properties.AdvancedModeOptions.SelectionColor = Color.Yellow;

新版本还实现了一个新的QueryAdvancedMode静态事件,此事件为项目中的每个TokenEdit控件触发,并允许您根据参数配置高级模式设置。

C#

cs 复制代码
using DevExpress.Utils;
using DevExpress.XtraEditors;
using System;
using System.Drawing;
using System.Windows.Forms;

namespace DXApplication {
internal static class Program {
[STAThread]
static void Main() {
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
TokenEdit.QueryAdvancedMode += TokenEdit1_QueryAdvancedMode;
Application.Run(new Form1());
}
static void TokenEdit1_QueryAdvancedMode(object sender, TokenEdit.QueryAdvancedModeEventArgs e) {
if(e.ParentForm is Form1) {
// Enable Advanced Mode.
e.UseAdvancedMode = DefaultBoolean.True;
// Set the selection color
e.Editor.Properties.AdvancedModeOptions.SelectionColor = Color.Yellow;
}
}
}
}
AI聊天控件
文件附件

用户现在可以将文件直接附加到他们的聊天消息中,这使得AI能够分析文档内容(如文本文件、PDF、图像),并提供更多的上下文感知响应。

启用FileUploadEnabled属性来允许用户附加文件,并根据您的项目需求配置相关设置(最大文件大小,允许的文件类型/扩展名,用户可以附加到消息的最大文件数量):

C#

cs 复制代码
aiChatControl1.FileUploadEnabled = DevExpress.Utils.DefaultBoolean.True;
提示建议

为了帮助用户开始或探索新的可能性,DevExpress AI聊天控件可以显示提示建议。

使用SetPromptSuggestions方法提供智能建议:

C#

cs 复制代码
using DevExpress.AIIntegration.Blazor.Chat.WebView;

aiChatControl1.SetPromptSuggestions(new List<PromptSuggestion>(){
new PromptSuggestion(
title: "Birthday Wish",
text: "A warm and cheerful birthday greeting message.",
prompt: "Write a heartfelt birthday message for a close friend."),

new PromptSuggestion(
"Thank You Note",
"A polite thank you note to express gratitude.",
"Compose a short thank you note to a colleague who helped with a project.")
});
停止响应

用户现在只需点击一下就可以打断冗长的AI回复。

相关推荐
脑电信号要分类4 小时前
将多张图片拼接成一个pdf文件输出
pdf·c#·apache
njsgcs4 小时前
c# solidworks 折弯系数检查
开发语言·c#
格林威6 小时前
工业相机图像采集:Grab Timeout 设置建议——拒绝“假死”与“丢帧”的黄金法则
开发语言·人工智能·数码相机·计算机视觉·c#·机器视觉·工业相机
唐青枫6 小时前
C#.NET SignalR + Redis Backplane 深入解析:多节点部署与跨实例消息同步
c#·.net
FL162386312919 小时前
[C#][winform]segment-anything分割万物部署onnx模型一键抠图演示
开发语言·c#
love530love20 小时前
OpenClaw 手机直连配置全流程
人工智能·windows·python·智能手机·c#·agent·openclaw
bcbobo21cn1 天前
C# byte类型和byte数组的使用
开发语言·c#·字节数组·byte类型
月巴月巴白勺合鸟月半1 天前
一次PDF文件的处理(一)
pdf·c#
大鹏说大话1 天前
Java 锁膨胀机制深度解析:从偏向锁到重量级锁的进化之路
开发语言·c#
武藤一雄1 天前
WPF处理耗时操作的7种方法
microsoft·c#·.net·wpf