mirror of
https://github.com/2dust/v2rayN.git
synced 2025-07-01 20:42:10 +00:00
Optimization and Improvement,DataGrid list only updates some attribute values
Some checks failed
Some checks failed
https://github.com/2dust/v2rayN/issues/7489
This commit is contained in:
parent
3df57f74ba
commit
3e71965cd4
3 changed files with 30 additions and 12 deletions
|
@ -1,9 +1,10 @@
|
||||||
|
using ReactiveUI;
|
||||||
using SQLite;
|
using SQLite;
|
||||||
|
|
||||||
namespace ServiceLib.Models;
|
namespace ServiceLib.Models;
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class ProfileItem
|
public class ProfileItem: ReactiveObject
|
||||||
{
|
{
|
||||||
public ProfileItem()
|
public ProfileItem()
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
using ReactiveUI.Fody.Helpers;
|
||||||
|
|
||||||
namespace ServiceLib.Models;
|
namespace ServiceLib.Models;
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
|
@ -5,13 +7,28 @@ public class ProfileItemModel : ProfileItem
|
||||||
{
|
{
|
||||||
public bool IsActive { get; set; }
|
public bool IsActive { get; set; }
|
||||||
public string SubRemarks { get; set; }
|
public string SubRemarks { get; set; }
|
||||||
|
|
||||||
|
[Reactive]
|
||||||
public int Delay { get; set; }
|
public int Delay { get; set; }
|
||||||
|
|
||||||
public decimal Speed { get; set; }
|
public decimal Speed { get; set; }
|
||||||
public int Sort { get; set; }
|
public int Sort { get; set; }
|
||||||
|
|
||||||
|
[Reactive]
|
||||||
public string DelayVal { get; set; }
|
public string DelayVal { get; set; }
|
||||||
|
|
||||||
|
[Reactive]
|
||||||
public string SpeedVal { get; set; }
|
public string SpeedVal { get; set; }
|
||||||
|
|
||||||
|
[Reactive]
|
||||||
public string TodayUp { get; set; }
|
public string TodayUp { get; set; }
|
||||||
|
|
||||||
|
[Reactive]
|
||||||
public string TodayDown { get; set; }
|
public string TodayDown { get; set; }
|
||||||
|
|
||||||
|
[Reactive]
|
||||||
public string TotalUp { get; set; }
|
public string TotalUp { get; set; }
|
||||||
|
|
||||||
|
[Reactive]
|
||||||
public string TotalDown { get; set; }
|
public string TotalDown { get; set; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -304,7 +304,7 @@ public class ProfilesViewModel : MyReactiveObject
|
||||||
{
|
{
|
||||||
item.SpeedVal = result.Speed ?? string.Empty;
|
item.SpeedVal = result.Speed ?? string.Empty;
|
||||||
}
|
}
|
||||||
_profileItems.Replace(item, JsonUtils.DeepCopy(item));
|
//_profileItems.Replace(item, JsonUtils.DeepCopy(item));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateStatistics(ServerSpeedItem update)
|
public void UpdateStatistics(ServerSpeedItem update)
|
||||||
|
@ -319,16 +319,16 @@ public class ProfilesViewModel : MyReactiveObject
|
||||||
item.TotalDown = Utils.HumanFy(update.TotalDown);
|
item.TotalDown = Utils.HumanFy(update.TotalDown);
|
||||||
item.TotalUp = Utils.HumanFy(update.TotalUp);
|
item.TotalUp = Utils.HumanFy(update.TotalUp);
|
||||||
|
|
||||||
if (SelectedProfile?.IndexId == item.IndexId)
|
//if (SelectedProfile?.IndexId == item.IndexId)
|
||||||
{
|
//{
|
||||||
var temp = JsonUtils.DeepCopy(item);
|
// var temp = JsonUtils.DeepCopy(item);
|
||||||
_profileItems.Replace(item, temp);
|
// _profileItems.Replace(item, temp);
|
||||||
SelectedProfile = temp;
|
// SelectedProfile = temp;
|
||||||
}
|
//}
|
||||||
else
|
//else
|
||||||
{
|
//{
|
||||||
_profileItems.Replace(item, JsonUtils.DeepCopy(item));
|
// _profileItems.Replace(item, JsonUtils.DeepCopy(item));
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
|
|
Loading…
Reference in a new issue