界面控件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回复。

相关推荐
miofly10 小时前
GitHub 今日推荐|SCSKiller:游戏着色器预编译消除卡顿
开源·c#·github
周杰伦fans1 天前
8GB显存下模型量化实战指南
人工智能·后端·c#
samble1 天前
从零搭建灌装监控系统(十二):配置系统,原子写入与容错
c#·wpf·mvvm·modbus·工业控制
流形填表1 天前
题库去重实战:基于题干指纹的重复题清理
开发语言·c#
开开心心就好1 天前
以图搜图找重复图片,本地工具离线就能用
javascript·智能手机·ffmpeg·c#·ocr·word·音视频
QQ_21696290961 天前
基于C#(Asp.net)电竞陪玩信息管理系统的设计与实现
java·大数据·spring boot·微信小程序·c#·云计算·asp.net
未来之窗软件服务2 天前
C# 截图源码支持自动保存-东方仙盟
c#·仙盟创梦ide·东方仙盟·电脑工具
UIU1142 天前
-7 / 2 在 C 里是 -3,在 Python 里是 -4,谁算错了?
c++·学习·c#
wflynn2 天前
GitHub 今日推荐|REDox:64 位 token 表示结构化数据,内存占用降 70% 支持多格式互转
开源·c#·github
驰骋工作流2 天前
C#/.NET 开源BPM工作流引擎6大常用对比选型分析驰骋BPM驰骋低代码低代码工作流引擎
开源·c#·.net