Linking to a static array in WPF?
I want to bind an element source in my WPF to a static array. I tried to do it by writing:
ItemsSource="{Binding XLTT.Core.Models.names}"
But that won't work. What for? Also, I've seen others bind to objects. Can I bind to a static array or should I bind to an object instead?
EDIT:
Here is a class with a definition names
.
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"};
}
}
+3
source to share