PartnerLineupPlanNestedCtrl.cs 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /// #pkgName FGUI包名
  2. /// #panelName UIPanel名字
  3. /// #UIName = $"{#pkgName}{#panelName}" UIKey名字
  4. /// 该脚本由模板创建
  5. /// created by cb 2024
  6. using FL.Data;
  7. using XGame.Framework.UI;
  8. namespace FL.FGUI
  9. {
  10. /// <summary>
  11. /// UI逻辑处理类
  12. /// </summary>
  13. /// <typeparam name=""></typeparam>
  14. public partial class PartnerLineupPlanNestedCtrl : UIController<PartnerLineupPlanNestedVM>
  15. {
  16. protected override void OnEnable(object intent)
  17. {
  18. AddUIListenres();
  19. }
  20. protected override void OnDisable()
  21. {
  22. RemoveUIListenres();
  23. }
  24. #region UI事件
  25. private void AddUIListenres()
  26. {
  27. EventSingle.Instance.AddListener(EventDefine.PartnerUpdatePlan, OnInfoUpdate);
  28. EventSingle.Instance.AddListener(EventDefine.PartnerUp, OnInfoUpdate);
  29. EventSingle.Instance.AddListener(EventDefine.PartnerDown, OnInfoUpdate);
  30. EventSingle.Instance.AddListener(EventDefine.PartnerPlanChange, OnInfoUpdate);
  31. EventSingle.Instance.AddListener(EventDefine.PartnerBinding, OnInfoUpdate);
  32. }
  33. private void RemoveUIListenres()
  34. {
  35. EventSingle.Instance.RemoveListener(EventDefine.PartnerUpdatePlan, OnInfoUpdate);
  36. EventSingle.Instance.RemoveListener(EventDefine.PartnerUp, OnInfoUpdate);
  37. EventSingle.Instance.RemoveListener(EventDefine.PartnerDown, OnInfoUpdate);
  38. EventSingle.Instance.RemoveListener(EventDefine.PartnerPlanChange, OnInfoUpdate);
  39. EventSingle.Instance.RemoveListener(EventDefine.PartnerBinding, OnInfoUpdate);
  40. }
  41. #endregion
  42. private void OnInfoUpdate(int eventId, object args)
  43. {
  44. ShowUI();
  45. }
  46. public void ShowUI()
  47. {
  48. VM.LineupPlanList.BindDatas(PartnersData.Instance.PlanList);
  49. }
  50. }
  51. }