public override FrameworkElement CreateCellElement(GridViewCell cell, object dataItem)
{
InputChannelInfo channel = dataItem as InputChannelInfo;
TextBlock tb = new TextBlock();
...
Binding colourBinding = new Binding("ChannelColour");
colourBinding.Source = channel;
cell.SetBinding(GridViewCell.BackgroundProperty, colourBinding);
return tb;
}
This however doesn't work; what happens is that the cell loads but the background remains white. When I use the GridViewCell's Loaded event and do the backgound binding there it will work and the background changes. However I am trying to avoid this way for other reasons. Is there a way to get the cell's background to change when doing the binding in CreateCellElement?