public override void Setup(ViewData data) { var eventViewMap = ConstructEventViewMap(); BosEventViewModel model = data.UserData as BosEventViewModel; if (model == null) { throw new ArgumentException($"ViewModel is null {nameof(data.UserData)}"); } ActivateView(eventViewMap, model); }
private void ActivateView(Dictionary <BosEventViewType, EventView> viewMap, BosEventViewModel model) { foreach (var kvp in viewMap) { if (kvp.Key == model.EventType) { kvp.Value.Show(model.Model); } else { kvp.Value.gameObject.Deactivate(); } } }