コード例 #1
0
        public void Handle(ShowPopupEvent message)
        {
            object vm = null;

            switch (message.PopupType)
            {
            case PopupType.ClosingPopup:
                vm = IoC.Get <ClosingPopupViewModel>();
                break;

            case PopupType.GameOverPopup:
                vm = IoC.Get <GameOverPopupViewModel>();
                break;

            case PopupType.CountdownPopup:
                vm = IoC.Get <CountdownPopupViewModel>();
                break;

            case PopupType.ButtonsPopup:
                vm = IoC.Get <ButtonsPopupViewModel>();
                break;
            }

            if (vm != null)
            {
                if (message.PopupSettings != null)
                {
                    message.PopupSettings(vm);
                }

                PopupItem           = vm as IPopup;
                PopupItem.IsShowing = true;
            }
        }
コード例 #2
0
 private void OnShowPopupEvent(ShowPopupEvent <PopupType> data)
 {
     if (data.Time == 0)
     {
         if (data.Data == null)
         {
             ShowPopup(data.PopupType);
         }
         else
         {
             ShowPopup(data.PopupType, data.Data);
         }
     }
     else
     {
         if (data.Data == null)
         {
             ShowPopup(data.PopupType, data.Time);
         }
         else
         {
             ShowPopup(data.PopupType, data.Time, data.Data);
         }
     }
 }