Fix ViewModel and UI (#10093)

* Fix avalonia ScrollToEnd

* Refactor ViewModel
This commit is contained in:
DHR60
2026-09-04 06:46:41 +00:00
committed by GitHub
parent fe2e219b7a
commit b8e8321603
20 changed files with 130 additions and 189 deletions
@@ -59,8 +59,6 @@ public partial class ClashConnectionsViewModel : MyReactiveObject
public async Task RefreshConnections(List<ConnectionItem>? connections)
{
ConnectionItems.Clear();
var dtNow = DateTime.Now;
var lstModel = new List<ClashConnectionModel>();
foreach (var item in connections ?? [])
@@ -85,12 +83,8 @@ public partial class ClashConnectionsViewModel : MyReactiveObject
lstModel.Add(model);
}
if (lstModel.Count <= 0)
{
return;
}
ConnectionItems.AddRange(lstModel);
ConnectionItems.ReplaceRange(lstModel);
await Task.CompletedTask;
}