/// <summary> /// すべてのViewModelを更新する(全Properties変更通知を出す) /// </summary> /// <param name="viewModelType"> /// 対象のViewModelのタイプ</param> public void RefreshAllViewModels( ViewCategories category = ViewCategories.Nothing) { foreach (var vm in this.GetViewModelList(category)) { vm.RaiseAllPropertiesChanged(); } }
/// <summary> /// ViewModelのリスト /// </summary> public IReadOnlyList <OverlayViewModelBase> GetViewModelList( ViewCategories category = ViewCategories.Nothing) { var list = new List <OverlayViewModelBase>(); if (TargetInfoWorker.Instance == null || FTInfoWorker.Instance == null || ToTInfoWorker.Instance == null || BossInfoWorker.Instance == null || MeInfoWorker.Instance == null || MobListWorker.Instance == null) { return(list); } switch (category) { case ViewCategories.Nothing: list.AddRange(TargetInfoWorker.Instance.ViewList.Select(x => x.ViewModel)); list.AddRange(FTInfoWorker.Instance.ViewList.Select(x => x.ViewModel)); list.AddRange(ToTInfoWorker.Instance.ViewList.Select(x => x.ViewModel)); list.AddRange(BossInfoWorker.Instance.ViewList.Select(x => x.ViewModel)); list.AddRange(MeInfoWorker.Instance.ViewList.Select(x => x.ViewModel)); list.AddRange(MobListWorker.Instance.ViewList.Select(x => x.ViewModel)); break; case ViewCategories.Target: list.AddRange(TargetInfoWorker.Instance.ViewList.Select(x => x.ViewModel)); break; case ViewCategories.FocusTarget: list.AddRange(FTInfoWorker.Instance.ViewList.Select(x => x.ViewModel)); break; case ViewCategories.TargetOfTarget: list.AddRange(ToTInfoWorker.Instance.ViewList.Select(x => x.ViewModel)); break; case ViewCategories.Boss: list.AddRange(BossInfoWorker.Instance.ViewList.Select(x => x.ViewModel)); break; case ViewCategories.Me: list.AddRange(MeInfoWorker.Instance.ViewList.Select(x => x.ViewModel)); break; case ViewCategories.MobList: list.AddRange(MobListWorker.Instance.ViewList.Select(x => x.ViewModel)); break; } return(list); }