添加添加数据库服务器表

修改扫码连接修复扫码闪退问题
This commit is contained in:
sc authored and sc committed 2026-05-02 12:47:17 +08:00
1 parent 6c0af56ea9
commit 0801e4875c
64 files changed
+3265

No files matched your search

+42
View File
@@ -0,0 +1,42 @@
using Microsoft.Maui.Controls.Shapes;
using SunlightAggregationTerminal.Models;
using System.Collections.ObjectModel;
namespace SunlightAggregationTerminal.NotificationView;
public partial class SystemPage : ContentPage
{
public ObservableCollection<NotificationItem> SystemItems { get; set; } = new();
public SystemPage()
{
InitializeComponent();
this.BindingContext = this;
LoadData(); // 加载数据
}
private void LoadData()
{
// 假设这是你获取数据的地方
var allData = DataService._NotificationData;
if (allData != null)
{
// 清空旧数据
SystemItems.Clear();
// 按时间倒序,并只取最新的 N 条(例如 50 条)
var itemsToShow = allData.OrderByDescending(x => x.Time).Take(50).Where(x => x.Type == MsgType.System);
// 将数据添加到集合中,UI 会自动更新
foreach (var item in itemsToShow)
{
SystemItems.Add(item);
}
}
}
private void CardCollectionView_RemainingItemsThresholdReached(object sender, EventArgs e)
{
}
}