diff --git a/v2rayN/ServiceLib/Models/CheckUpdateModel.cs b/v2rayN/ServiceLib/Models/CheckUpdateModel.cs index 85225bc1..f06eedc9 100644 --- a/v2rayN/ServiceLib/Models/CheckUpdateModel.cs +++ b/v2rayN/ServiceLib/Models/CheckUpdateModel.cs @@ -1,10 +1,13 @@ +using ReactiveUI; +using ReactiveUI.Fody.Helpers; + namespace ServiceLib.Models; -public class CheckUpdateModel +public class CheckUpdateModel : ReactiveObject { public bool? IsSelected { get; set; } public string? CoreType { get; set; } - public string? Remarks { get; set; } + [Reactive] public string? Remarks { get; set; } public string? FileName { get; set; } public bool? IsFinished { get; set; } } diff --git a/v2rayN/ServiceLib/Models/ClashProxyModel.cs b/v2rayN/ServiceLib/Models/ClashProxyModel.cs index fd534309..014b0f12 100644 --- a/v2rayN/ServiceLib/Models/ClashProxyModel.cs +++ b/v2rayN/ServiceLib/Models/ClashProxyModel.cs @@ -1,7 +1,10 @@ +using ReactiveUI; +using ReactiveUI.Fody.Helpers; + namespace ServiceLib.Models; [Serializable] -public class ClashProxyModel +public class ClashProxyModel : ReactiveObject { public string? Name { get; set; } @@ -9,9 +12,9 @@ public class ClashProxyModel public string? Now { get; set; } - public int Delay { get; set; } + [Reactive] public int Delay { get; set; } - public string? DelayName { get; set; } + [Reactive] public string? DelayName { get; set; } public bool IsActive { get; set; } } diff --git a/v2rayN/ServiceLib/ViewModels/CheckUpdateViewModel.cs b/v2rayN/ServiceLib/ViewModels/CheckUpdateViewModel.cs index 23839141..9dd43a75 100644 --- a/v2rayN/ServiceLib/ViewModels/CheckUpdateViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/CheckUpdateViewModel.cs @@ -334,9 +334,6 @@ public class CheckUpdateViewModel : MyReactiveObject { return; } - - var itemCopy = JsonUtils.DeepCopy(found); - itemCopy.Remarks = model.Remarks; - CheckUpdateModels.Replace(found, itemCopy); + found.Remarks = model.Remarks; } } diff --git a/v2rayN/ServiceLib/ViewModels/ClashProxiesViewModel.cs b/v2rayN/ServiceLib/ViewModels/ClashProxiesViewModel.cs index 54cbdc8d..343d49df 100644 --- a/v2rayN/ServiceLib/ViewModels/ClashProxiesViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/ClashProxiesViewModel.cs @@ -391,7 +391,6 @@ public class ClashProxiesViewModel : MyReactiveObject public async Task ProxiesDelayTestResult(SpeedTestResult result) { - //UpdateHandler(false, $"{item.name}={result}"); var detail = ProxyDetails.FirstOrDefault(it => it.Name == result.IndexId); if (detail == null) { @@ -414,7 +413,6 @@ public class ClashProxiesViewModel : MyReactiveObject detail.Delay = _delayTimeout; detail.DelayName = string.Empty; } - ProxyDetails.Replace(detail, JsonUtils.DeepCopy(detail)); } #endregion proxy function diff --git a/v2rayN/ServiceLib/ViewModels/ProfilesViewModel.cs b/v2rayN/ServiceLib/ViewModels/ProfilesViewModel.cs index 14216fee..4c0fd2b9 100644 --- a/v2rayN/ServiceLib/ViewModels/ProfilesViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/ProfilesViewModel.cs @@ -293,7 +293,6 @@ public class ProfilesViewModel : MyReactiveObject { item.SpeedVal = result.Speed ?? string.Empty; } - //_profileItems.Replace(item, JsonUtils.DeepCopy(item)); } public async Task UpdateStatistics(ServerSpeedItem update) @@ -314,17 +313,6 @@ public class ProfilesViewModel : MyReactiveObject item.TodayUp = Utils.HumanFy(update.TodayUp); item.TotalDown = Utils.HumanFy(update.TotalDown); item.TotalUp = Utils.HumanFy(update.TotalUp); - - //if (SelectedProfile?.IndexId == item.IndexId) - //{ - // var temp = JsonUtils.DeepCopy(item); - // _profileItems.Replace(item, temp); - // SelectedProfile = temp; - //} - //else - //{ - // _profileItems.Replace(item, JsonUtils.DeepCopy(item)); - //} } } catch