升级1.6.2,Modal自定义按钮支持异步回调

ChatList的AddIsBottom方法名修改为AddToBottom
This commit is contained in:
czz_y 2024-09-23 17:18:47 +08:00
parent dff516c1e4
commit be234dadf6
5 changed files with 30 additions and 20 deletions

View File

@ -13,7 +13,7 @@
<Copyright>Copyright © 2024 czz_y</Copyright>
<FileVersion>$(Version)</FileVersion>
<AssemblyVersion>$(Version)</AssemblyVersion>
<Version>1.6.1</Version>
<Version>1.6.2</Version>
<Authors>czz_y</Authors>
<Description>基于 Winform UI框架 AntdUI 设计的Demo</Description>
<PackageProjectUrl>https://gitee.com/mubaiyanghua/antd-uidemo</PackageProjectUrl>
@ -30,7 +30,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="AntdUI" Version="1.6.1" />
<PackageReference Include="AntdUI" Version="1.6.3" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="NLog" Version="5.3.3" />
</ItemGroup>

30
MainWindow.Designer.cs generated
View File

@ -30,13 +30,13 @@
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainWindow));
this.titlebar = new AntdUI.WindowBar();
this.input_search = new AntdUI.Input();
this.button_color = new AntdUI.Button();
this.buttonSZ = new AntdUI.Button();
this.divider = new AntdUI.Divider();
this.menu = new AntdUI.Menu();
this.panel_content = new AntdUI.StackPanel();
this.label1 = new AntdUI.Label();
this.input_search = new AntdUI.Input();
this.titlebar.SuspendLayout();
this.panel_content.SuspendLayout();
this.SuspendLayout();
@ -57,6 +57,18 @@
this.titlebar.TabIndex = 0;
this.titlebar.Text = "AntdUI";
//
// input_search
//
this.input_search.AllowClear = true;
this.input_search.Dock = System.Windows.Forms.DockStyle.Right;
this.input_search.Font = new System.Drawing.Font("Microsoft YaHei UI", 10F);
this.input_search.Location = new System.Drawing.Point(596, 0);
this.input_search.Name = "input_search";
this.input_search.PlaceholderText = "输入关键字搜索...";
this.input_search.PrefixSvg = "SearchOutlined";
this.input_search.Size = new System.Drawing.Size(200, 40);
this.input_search.TabIndex = 2;
//
// button_color
//
this.button_color.Dock = System.Windows.Forms.DockStyle.Right;
@ -115,26 +127,15 @@
//
// label1
//
this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
this.label1.Font = new System.Drawing.Font("Microsoft YaHei UI", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label1.Location = new System.Drawing.Point(3, 3);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(693, 563);
this.label1.Size = new System.Drawing.Size(709, 503);
this.label1.TabIndex = 0;
this.label1.Text = "欢迎使用 AntdUI Demo";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// input_search
//
this.input_search.AllowClear = true;
this.input_search.Dock = System.Windows.Forms.DockStyle.Right;
this.input_search.Font = new System.Drawing.Font("Microsoft YaHei UI", 10F);
this.input_search.Location = new System.Drawing.Point(596, 0);
this.input_search.Name = "input_search";
this.input_search.PlaceholderText = "输入关键字搜索...";
this.input_search.PrefixSvg = "SearchOutlined";
this.input_search.Size = new System.Drawing.Size(200, 40);
this.input_search.TabIndex = 2;
//
// MainWindow
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@ -146,7 +147,6 @@
this.Controls.Add(this.titlebar);
this.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Mode = AntdUI.TAMode.Auto;
this.Name = "MainWindow";
this.Opacity = 0.99D;
this.Padding = new System.Windows.Forms.Padding(6, 0, 0, 6);

View File

@ -4,7 +4,7 @@
<h1>AntdUI Demo</h1>
本项目基于 `Winform .NET Framework 4.8` 开发,是 [AntdUI](https://gitee.com/antdui/AntdUI) 的 Demo 项目,当前版本 `1.6.1`
本项目基于 `Winform .NET Framework 4.8` 开发,是 [AntdUI](https://gitee.com/antdui/AntdUI) 的 Demo 项目,当前版本 `1.6.2`
</div>

View File

@ -57,7 +57,7 @@ namespace AntdUIDemo.Views
#region GPT
var msg = new AntdUI.Chat.TextChatItem("", Properties.Resources.head, "2.0T 银");
bool isbut = chatList.AddIsBottom(msg);
bool isbut = chatList.AddToBottom(msg);
msg.Loading = true;
Thread.Sleep(1200);

View File

@ -87,13 +87,23 @@ namespace AntdUIDemo.Views
OkText = "Search On Google",
OnOk = config =>
{
//执行耗时操作,仅OK按钮支持异步响应
Thread.Sleep(2000);
return true;
},
OnBtns = button =>
{
//1.6.2起,自定义按钮支持异步委托
Thread.Sleep(2000);
AntdUI.Message.info(window, button.Text, autoClose: 1);
switch (button.Text)
{
case "Return":
return false;
case "Submit":
return true;
default:
return true;
}
}
});
}