独立ChatMessage类

This commit is contained in:
lihanbo 2025-02-28 10:26:58 +08:00
parent 6c02a38c3f
commit 1aaed2ce0e
2 changed files with 60 additions and 51 deletions

View File

@ -131,54 +131,4 @@ namespace ExcelHelper.Views.Components
}
}
}
// 聊天消息类
public class ChatMessage : INotifyPropertyChanged
{
private string _content;
public string Content
{
get
{
return _content;
}
set
{
_content = value;
OnPropertyChanged(nameof(Content));
}
}
private bool _isUser;
public bool IsUser
{
get
{
return _isUser;
}
set
{
_isUser = value;
OnPropertyChanged(nameof(IsUser));
}
}
private DateTime _timestamp = DateTime.Now;
public DateTime Timestamp
{
get
{
return _timestamp;
}
set
{
_timestamp = value;
OnPropertyChanged(nameof(Timestamp));
}
}
public event PropertyChangedEventHandler PropertyChanged;
public void OnPropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
}

View File

@ -0,0 +1,59 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ExcelHelper.Views.Components
{
// 聊天消息类
public class ChatMessage : INotifyPropertyChanged
{
private string _content;
public string Content
{
get
{
return _content;
}
set
{
_content = value;
OnPropertyChanged(nameof(Content));
}
}
private bool _isUser;
public bool IsUser
{
get
{
return _isUser;
}
set
{
_isUser = value;
OnPropertyChanged(nameof(IsUser));
}
}
private DateTime _timestamp = DateTime.Now;
public DateTime Timestamp
{
get
{
return _timestamp;
}
set
{
_timestamp = value;
OnPropertyChanged(nameof(Timestamp));
}
}
public event PropertyChangedEventHandler PropertyChanged;
public void OnPropertyChanged(string propertyName)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
}