Merge branch 'master' of http://192.168.0.12:13000/sc/SunlightAggregationTerminal
This commit is contained in:
commit
ee00cfd25f
6 files changed
+209
-36
No files matched your search
@@ -17,14 +17,13 @@ public partial class MessagePage : ContentPage
|
||||
|
||||
private void LoadData()
|
||||
{
|
||||
// 假设这是你获取数据的地方
|
||||
var allData = DataService._NotificationData;
|
||||
if (allData != null)
|
||||
{
|
||||
// 清空旧数据
|
||||
MessageItems.Clear();
|
||||
|
||||
// 按时间倒序,并只取最新的 N 条(例如 50 条)
|
||||
// 按时间倒序,并只取最新的 50 条
|
||||
var itemsToShow = allData.OrderByDescending(x => x.Time).Take(50).Where(x => x.Type == MsgType.Message);
|
||||
|
||||
// 将数据添加到集合中,UI 会自动更新
|
||||
|
||||
Reference in new issue
Block a user