I want to bind an item source in my WPF to a static array. I have tried to do this by writing:
ItemsSource="{Binding XLTT.Core.Models.names}"
But it doesn't work. Why? Additionally, I have seen others bind to objects. Is it ok to bind to a static array or should I be binding to an object instead?
EDIT:
Here is the class with names
definition.
namespace XLTT.Core.Models
{
internal class TTColumn
{
internal string ColumnName;
internal string ColumnType;
internal int ColumnOrder;
internal bool IsRequired;
internal int ColumnWidth;
public static string[] names = {"Matt", "Joanne", "Robert"};
}
}