Hello! I just started using MonoGame.Extended.Gui and am trying to display a variable number of buttons. So far, my code looks like this:
ControlCollection buttons = new ControlCollection();
for (int i = 0; i < actions.Length; i++)
{
IActionable action = actions[i];
buttons.Add(new Button
{
Content = action.Name
});
}
Screen screen = new Screen
{
Content = new DockPanel
{
LastChildFill = false,
Items =
{
new StackPanel { Items = buttons }
}
}
};
but it doesn’t compile, saying that ItemsControl.Items is readonly. Any pointers as to what I’m missing would be appreciated!