Make get-only collections editable in propertygrid
This commit is contained in:
@@ -150,7 +150,7 @@ namespace Torch.Views
|
|||||||
valueControl = (FrameworkElement)Activator.CreateInstance(descriptor.EditorType);
|
valueControl = (FrameworkElement)Activator.CreateInstance(descriptor.EditorType);
|
||||||
valueControl.SetBinding(FrameworkElement.DataContextProperty, property.Name);
|
valueControl.SetBinding(FrameworkElement.DataContextProperty, property.Name);
|
||||||
}
|
}
|
||||||
else if (property.GetSetMethod() == null || descriptor?.ReadOnly == true)
|
else if (property.GetSetMethod() == null && !(propertyType.IsGenericType && typeof(ICollection).IsAssignableFrom(propertyType.GetGenericTypeDefinition()))|| descriptor?.ReadOnly == true)
|
||||||
{
|
{
|
||||||
valueControl = new TextBlock();
|
valueControl = new TextBlock();
|
||||||
var binding = new Binding(property.Name)
|
var binding = new Binding(property.Name)
|
||||||
|
Reference in New Issue
Block a user