private void BuildProxyColumns()
{
// Is there a change to the column definitions?
if (_columns.IsDirty)
{
// Do we need to recreate the proxy array?
if ((_proxyColumns == null) || (_proxyColumns.Length != _columns.Count))
{
// Always need at least one column
_proxyColumns = new DefinitionProxy[Math.Max(1, _columns.Count)];
}
// Hook each column into the matching proxy
for (int i = 0; i < _columns.Count; i++)
_proxyColumns[i] = new DefinitionProxy(_columns[i]);
// Our artifical column needs to point at a real column definition
if (_columns.Count == 0)
_proxyColumns[0] = new DefinitionProxy(new ColumnDefinition());
}
}