It seems you can use a converter to convert your Boolean value to right background specified in your App.Resources -
<GridViewColumn Width ="50" Header="GEN" >
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=Gen}" Background="{Binding Gen, Converter={StaticResource BackgroundConverter}}" />
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
The Converter will look something like -
class BackgroundConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value != null && value is bool && (bool)value)
{
return Application.Current.FindResource("ActiveBrush");
}
return Application.Current.FindResource("DefaultBrush");
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotSupportedException();
}
}
Add the brushes in your App.Resources -
<SolidColorBrush x:Key="DefaultBrush" Color="Red" />
<SolidColorBrush x:Key="ActiveBrush" Color="Yellow" />