UIExtensions.cs 676 B

123456789101112131415161718192021
  1. using XGame.Framework;
  2. using XGame.Framework.UI;
  3. namespace FL.FGUI
  4. {
  5. internal static class UIExtensions
  6. {
  7. public static void ShowTips(this UIContext context, string tips)
  8. {
  9. EventSingle.Instance.Notify(EventDefine.ShowTips, tips);
  10. }
  11. public static void AddListener(this UIContext context, EventDefine eventId, EventDelegate handler)
  12. {
  13. EventSingle.Instance.AddListener(eventId, handler);
  14. }
  15. public static void RemoveListener(this UIContext context, EventDefine eventId, EventDelegate handler)
  16. {
  17. EventSingle.Instance.RemoveListener(eventId, handler);
  18. }
  19. }
  20. }