Browse Source

Fix edior not loading directyl when value is null

pull/10368/head
pr8x 4 years ago
parent
commit
252f02b21e
  1. 26
      src/Avalonia.Diagnostics/Diagnostics/Controls/PropertyValueEditor.cs

26
src/Avalonia.Diagnostics/Diagnostics/Controls/PropertyValueEditor.cs

@ -51,7 +51,16 @@ namespace Avalonia.Diagnostics.Controls
public object? Value
{
get => _value;
set => SetAndRaise(ValueProperty, ref _value, value);
set
{
if (_needsUpdate)
{
_needsUpdate = false;
Child = UpdateControl();
}
SetAndRaise(ValueProperty, ref _value, value);
}
}
public Type? ValueType
@ -77,13 +86,6 @@ namespace Avalonia.Diagnostics.Controls
_needsUpdate = true;
}
if (change.Property == ValueProperty && _needsUpdate)
{
_needsUpdate = false;
Child = UpdateControl();
}
}
//Unfortunately we cannot use TwoWay bindings as they update the source with the target value
@ -202,13 +204,7 @@ namespace Avalonia.Diagnostics.Controls
img.HorizontalAlignment = HorizontalAlignment.Stretch;
img.PointerPressed += (_, _) =>
new Window
{
Content = new Image
{
Source = img.Source
}
}.Show();
new Window { Content = new Image { Source = img.Source } }.Show();
});
if (ValueType.IsEnum)

Loading…
Cancel
Save