antdui-demo/Views/MsgListDemo.cs
2024-10-12 15:34:19 +08:00

49 lines
1.6 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace AntdUIDemo.Views
{
public partial class MsgListDemo : UserControl
{
public MsgListDemo()
{
InitializeComponent();
// 绑定事件
BindEventHandler();
}
private void BindEventHandler()
{
Task.Factory.StartNew(() =>
{
msgList.Items.Add(new AntdUI.Chat.MsgItem("WPF / Flutter UI", Properties.Resources.head)
{
Select = true,
Text = "AduSkin我初三就上班啦",
Time = DateTime.Now.ToString("HH:mm:ss")
});
Thread.Sleep(1000);
msgList.Items.Add(new AntdUI.Chat.MsgItem("宝宝", Properties.Resources.head)
{
Text = "今天给你买一束花",
Time = DateTime.Now.ToString("HH:mm:ss")
});
Thread.Sleep(1000);
msgList.Items.Add(new AntdUI.Chat.MsgItem("AntdUI", Properties.Resources.head)
{
Text = "Tom❤AntDesign设计语言的Winform界面库",
Time = DateTime.Now.ToString("HH:mm:ss")
});
Thread.Sleep(1000);
msgList.Items.Add(new AntdUI.Chat.MsgItem("AntdUI", Properties.Resources.head)
{
Text = "晚上一起 Crazy Day 4",
Time = "疯狂星期四"
});
});
}
}
}