mirror of
https://github.com/ZuneDev/ZuneUIXTools.git
synced 2026-07-27 13:11:59 -07:00
Do not attempt to show null values in inspector
This commit is contained in:
@@ -93,7 +93,10 @@ public class UIBDisassemblyViewModel : Document
|
||||
InspectableObjectBuilder builder = new InspectableObjectBuilder()
|
||||
.WithObjectProperties(instance, filter);
|
||||
|
||||
var valueProperty = TypeDescriptor.CreateProperty(typeof(InterpreterObject), "Value", instance.Value?.GetType());
|
||||
var valueType = instance.Value?.GetType() ?? instance.Type;
|
||||
if (valueType is not null)
|
||||
{
|
||||
PropertyDescriptor valueProperty = TypeDescriptor.CreateProperty(typeof(InterpreterObject), "Value", valueType);
|
||||
IEditor editor = DefaultPropertyInspectors.CreateEditor(valueProperty);
|
||||
if (editor is null)
|
||||
{
|
||||
@@ -108,6 +111,7 @@ public class UIBDisassemblyViewModel : Document
|
||||
editor.BoundPropertyDescriptor = new BoundPropertyDescriptor(instance, valueProperty);
|
||||
builder = builder.WithEditor(instance, i => i.Value, editor);
|
||||
}
|
||||
}
|
||||
|
||||
return builder.ToInspectableObject();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user