[C#] eventHandler with menu


#1

How to add EventHandlers on my menu ?


var submenu = _menuPool.AddSubMenu(menu, "Player");
        submenu.AddItem(new UIMenuItem("test", "Sample description that takes more than one line. Moreso, it takes way more than two lines since it's so long. Wow, check out this length!"));


EventHandlers["playerSpawned"] += new Action<dynamic>(dyn =>
{
     TriggerEvent("chatMessage", "", new []{ 0, 0, 0 }, "Welcome to CoreRP.");
});