示例#1
0
        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);
        }
示例#2
0
 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();
         }
     }
 }