Inside the collection control, at the moment it can only support class types due to the fact it checks to see if there is a default constructor. On struct types, there is a constructor for each data member, but declaring without using the constructor still works by sending 0's.
private void CanAddNew(object sender, CanExecuteRoutedEventArgs e)
{
Type t = e.Parameter as Type;
if (t != null && (t.IsValueType || t.GetConstructor(Type.EmptyTypes) != null))
e.CanExecute = true;
}
Adding the check for value type gets around this problem.
Comments: ** Comment from web user: BoucherS **
private void CanAddNew(object sender, CanExecuteRoutedEventArgs e)
{
Type t = e.Parameter as Type;
if (t != null && (t.IsValueType || t.GetConstructor(Type.EmptyTypes) != null))
e.CanExecute = true;
}
Adding the check for value type gets around this problem.
Comments: ** Comment from web user: BoucherS **
Hi,
This will be fixed in v2.9.