示例代碼: PT_USER_INFO user = new PT_USER_INFO(); IList<TES_COMBAT_TASK> taskList = new List<TES_COMBAT_TASK>(); BackgroundWorker worker = new BackgroundW ...
示例代碼:
PT_USER_INFO user = new PT_USER_INFO(); IList<TES_COMBAT_TASK> taskList = new List<TES_COMBAT_TASK>(); BackgroundWorker worker = new BackgroundWorker(); worker.DoWork += (s, e) => { user = HI.Get<Cache.ICacheService>().UserCache.GetCurrentUserInfo(); taskList = HI.Get<ITaskService>().GetCombatTaskByUserIDUnfinished(user.ID.ToString()); }; worker.RunWorkerCompleted += (s, e) => { try { taskListView.ItemsSource = taskList; } catch { } }; worker.RunWorkerAsync();View Code