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

Edited Issue: CollectionControl needs to support struct/value types [19535]

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

Hi,

This will be fixed in v2.9.


Viewing all articles
Browse latest Browse all 4964

Trending Articles



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