Hi
I have a grid that font color converter behaves weird
this is the column
<sf:GridTextColumn x:Name="colSubject" MappingName="v_subject" ShowToolTip="True" IsHidden="True" HeaderText="Subject" >
<sf:GridTextColumn.CellStyle>
<Style TargetType="sf:GridCell">
<Setter Property="BorderThickness" Value="0.3" />
<Setter Property="BorderBrush" Value="#dcdcdc" />
<Setter Property="Foreground">
<Setter.Value>
<MultiBinding Converter="{StaticResource fontColorConverterMULTI}" Mode="TwoWay">
<Binding Path="n_status" />
<Binding Path="v_text_color" />
</MultiBinding>
</Setter.Value> </Setter>
<Setter Property="FontWeight" Value="{Binding Path=n_status, Mode=TwoWay, Converter={StaticResource fontWeightConverter}}" />
</Style>
</sf:GridTextColumn.CellStyle>
</sf:GridTextColumn>
and this is the converter
public class FontColorConverterMULTI : IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
if (values == null)
return DependencyProperty.UnsetValue;
//new AGW_DEBUG.AGWDebugLog("values=" + values.Length);
foreach (var item in values)
{
if (item == null)
continue;
if (item.GetType() == typeof(int))
{
if ((int)item == (int)LeftTreeAccounts.MAILSTATUS.MAILSTATUS_UNREAD)
{
System.Diagnostics.Debug.WriteLine("return BlueViolet");
return new SolidColorBrush(Colors.BlueViolet);
}
}
if (item.GetType() == typeof(string))
{
string strTextColor = (string)item;
if (string.IsNullOrEmpty(strTextColor))
return DependencyProperty.UnsetValue;
else
{
System.Diagnostics.Debug.WriteLine("return "+ strTextColor);
return (new BrushConverter().ConvertFromString(strTextColor)) as SolidColorBrush;
}
}
}
return DependencyProperty.UnsetValue;
}
public object[] ConvertBack(object value, Type[] targetType, object parameter, CultureInfo culture)
{
return null;
}
}
it always shows black color although from debugging I can see that returns different color brushes
Thank you for the help in advance
George