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

Commented Issue: Crash on array in PrimitiveTypeCollectionEditor (correction included) [18923]

$
0
0
namespace Xceed.Wpf.Toolkit.PropertyGrid.Editors
{
public class PrimitiveTypeCollectionEditor : TypeEditor
{
protected override void SetControlProperties()
{
Editor.BorderThickness = new System.Windows.Thickness(0);
Editor.Content = "(Collection)";
}

protected override void SetValueDependencyProperty()
{
ValueProperty = Xceed.Wpf.Toolkit.PrimitiveTypeCollectionEditor.ItemsSourceProperty;
}

protected override void ResolveValueBinding(PropertyItem propertyItem)
{
Editor.ItemsSourceType = propertyItem.PropertyType;

//EO: Next line should be modified to support Array also
//old line: Editor.ItemType = propertyItem.PropertyType.GetGenericArguments()[0];
// Replaced with next "if-else"
if (propertyItem.PropertyType.IsGenericType)
{
Editor.ItemType = propertyItem.PropertyType.GetGenericArguments()[0];
}
else
{
Editor.ItemType = propertyItem.PropertyType.GetElementType();
}

base.ResolveValueBinding(propertyItem);
}
}
}
Comments: ** Comment from web user: BoucherS **

Fixed in v2.1


Viewing all articles
Browse latest Browse all 4964

Trending Articles



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