After further tests, it seems that the "value" must implement IConvertible interface and the update trigger an "InvalidCastException" for some type (or when "value" is null), I updated the code like that:
Code:
if (value is IConvertible)
{
mValue = (T)Convert.ChangeType(value, typeof(T));
}
else
{
mValue = (T)value;
}