I'am unable to add/edit new element to collection of struct type (ex System.Windows.Point) because CanAddNew EventHandler is checking for parameterless constructor which fails with struct types.
sugestion change:
original
if ((parameter != null) && (parameter.GetConstructor(Type.EmptyTypes) != null))
{
e.CanExecute = true;
}
to
bool isComplexStruct = testType.IsValueType && !testType.IsEnum && !testType.IsPrimitive;
if ((parameter != null) &&
( isComplexStruct || (parameter.GetConstructor(Type.EmptyTypes) != null)) )
{
e.CanExecute = true;
}
P.S.
I'am using this lib only couple of minuts, so please excuse me if I've missed something.
Comments: ** Comment from web user: BoucherS **
sugestion change:
original
if ((parameter != null) && (parameter.GetConstructor(Type.EmptyTypes) != null))
{
e.CanExecute = true;
}
to
bool isComplexStruct = testType.IsValueType && !testType.IsEnum && !testType.IsPrimitive;
if ((parameter != null) &&
( isComplexStruct || (parameter.GetConstructor(Type.EmptyTypes) != null)) )
{
e.CanExecute = true;
}
P.S.
I'am using this lib only couple of minuts, so please excuse me if I've missed something.
Comments: ** Comment from web user: BoucherS **
Hi,
This will be fixed in v2.9.
Thanks.