private object ConvertValue(object value, Type targetType)
{
if (value != null && value.GetType() == targetType)
return value;
object convertedValue = value;
try
{
convertedValue = Convert(convertedValue, targetType, ValueConverter);
}
catch (NotImplementedException)
{
}
return convertedValue;
}