Skip to content

Commit 22b37bb

Browse files
committed
fix after merge from 3.8
1 parent 1e24f02 commit 22b37bb

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Src/Xceed.Wpf.Toolkit/PropertyGrid/Implementation/Editors/PrimitiveTypeCollectionEditor.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ This program is provided to you under the terms of the Microsoft Public
1414
1515
***********************************************************************************/
1616

17+
using System.Collections.Generic;
18+
using System.Linq;
1719
using System.Windows;
1820

1921
namespace Xceed.Wpf.Toolkit.PropertyGrid.Editors
@@ -41,7 +43,12 @@ protected override void ResolveValueBinding( PropertyItem propertyItem )
4143
var type = propertyItem.PropertyType;
4244
Editor.ItemsSourceType = type;
4345

44-
if( type.BaseType == typeof( System.Array ) )
46+
var icollection = propertyItem.PropertyType.GetInterfaces().FirstOrDefault(x => x.IsGenericType && x.GetGenericTypeDefinition() == typeof(ICollection<>));
47+
if (icollection != null)
48+
{
49+
Editor.ItemType = icollection.GetGenericArguments()[0];
50+
}
51+
else if ( type.BaseType == typeof( System.Array ) )
4552
{
4653
Editor.ItemType = type.GetElementType();
4754
}

0 commit comments

Comments
 (0)