fix.修复了一些界面的性能问题

This commit is contained in:
MistEO
2022-06-09 19:58:46 +08:00
parent a30fce47dd
commit 57eb6f62f2
2 changed files with 24 additions and 9 deletions

View File

@@ -1050,10 +1050,10 @@ namespace MeoAsstGui
}
}
public void ManualUpdate()
public async void ManualUpdate()
{
var updateModle = _container.Get<VersionUpdateViewModel>();
Task.Run(() =>
var task = Task.Run(() =>
{
if (!updateModle.CheckAndDownloadUpdate(true)
&& !updateModle.ResourceOTA(true))
@@ -1064,6 +1064,7 @@ namespace MeoAsstGui
}
}
});
await task;
}
/* 连接设置 */

View File

@@ -647,11 +647,9 @@ namespace MeoAsstGui
{
return a.Value.CompareTo(b.Value);
});
AllDropsList = new ObservableCollection<CombData>(AllDrops);
DropsList = AllDropsList;
DropsList = new ObservableCollection<CombData>(AllDrops);
}
public ObservableCollection<CombData> AllDropsList { get; set; }
public ObservableCollection<CombData> DropsList { get; set; }
private string _dropsItemId = ViewStatusStorage.Get("MainFunction.Drops.ItemId", "0");
@@ -665,15 +663,31 @@ namespace MeoAsstGui
}
}
//这里可以选择从gui.json里取上一次的选择(?)
private string _dropsItem = "";
private bool _isFirstLoadDropItem = true;
private long _preSetDropsItemTicks = 0;
public string DropsItem
{
get { return _dropsItem; }
set
{
IsDropDown = "True";
if (_isFirstLoadDropItem)
{
_isFirstLoadDropItem = false;
}
else
{
IsDropDown = true;
}
// 这里有个很严重的死循环性能问题不知道怎么解决简单做个消抖好了_(:з」∠)_
if (DateTime.Now.Ticks - _preSetDropsItemTicks < 50)
{
return;
}
_preSetDropsItemTicks = DateTime.Now.Ticks;
DropsList.Clear();
foreach (CombData drop in AllDrops)
{
@@ -687,9 +701,9 @@ namespace MeoAsstGui
}
}
private string _isDropDown = "False";
private bool _isDropDown = false;
public string IsDropDown
public bool IsDropDown
{
get { return _isDropDown; }
set