Quantcast
Channel: Extended WPF Toolkit™ Community Edition
Viewing all articles
Browse latest Browse all 4964

Edited Issue: CollectionEditor Add struct type [18673]

$
0
0
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 **

Hi,

This will be fixed in v2.9.
Thanks.


Viewing all articles
Browse latest Browse all 4964

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>