public async void Initialize() { IsActive = true; Status = "更新中"; NowLiveList.Clear(); var list = await NotifyInstance.GetLiveInformationAsync(); if (list != null) { foreach (var entry in list) { NowLiveList.Add(new LiveNotifyEntryViewModel(entry)); } Badge = list.Count; } else { Badge = null; } IsActive = false; Status = ""; }
public void Refresh() { Task.Run(() => { IsActive = true; Status = "更新中"; NowLiveList.Clear(); var list = LiveInstance.GetLiveInformation(); if (list != null) { foreach (var entry in list) { NowLiveList.Add(entry); } Badge = list.Count; } else { Badge = null; } IsActive = false; Status = ""; }); }