To bind Button to UIButton help content create a button with ID like this:
Code:
Button farmerButton = new Button() { X = 4, Y = 27, Width = 203, Height = 14, ID = "farmerbutton" };
farmerButton.OnClick += new ButtonClickedHandler(farmerButton_OnClick);
Buttons.Add(farmerButton.ID, farmerButton);
And have UIButton with same ID. I will keep working on the mechanics (effect, graphics, race variables etc.) as well as adding content.
All the buttons for UI are already created, so I'm not sure if its worth to create a function to do the above in less lines of code, like
Button fb = CreateButton("farmerbutton", "farmerButton_OnClick");
Besides, adjusting the coordinates etc. is faster from the code. So Why did I add X and Y to UIButton? I have no idea, it seemed like a good idea at the time :P