Browse Source

Correctly handle UnsetValue/DoNothing in setters.

Just need to call `BindingValue<T>.FromUntyped` instead of doing a conditional, because otherwise we run the risk of passing `UnsetValue` to the `BindingValue<T>` ctor which will throw in that case.
pull/4446/head
Steven Kirk 6 years ago
parent
commit
de8171f8ac
  1. 2
      src/Avalonia.Styling/Styling/PropertySetterBindingInstance.cs

2
src/Avalonia.Styling/Styling/PropertySetterBindingInstance.cs

@ -164,7 +164,7 @@ namespace Avalonia.Styling
private void ConvertAndPublishNext(object? value)
{
_value = value is T v ? v : BindingValue<T>.FromUntyped(value);
_value = BindingValue<T>.FromUntyped(value);
if (_isActive)
{

Loading…
Cancel
Save