Browse Source

fixes: PropertySetterInstance

pull/6754/head
Giuseppe Lippolis 5 years ago
parent
commit
72fd5f0105
  1. 6
      src/Avalonia.Styling/Styling/PropertySetterInstance.cs
  2. 2
      src/Avalonia.Styling/Styling/Setter.cs

6
src/Avalonia.Styling/Styling/PropertySetterInstance.cs

@ -16,14 +16,14 @@ namespace Avalonia.Styling
private readonly IStyleable _target; private readonly IStyleable _target;
private readonly StyledPropertyBase<T>? _styledProperty; private readonly StyledPropertyBase<T>? _styledProperty;
private readonly DirectPropertyBase<T>? _directProperty; private readonly DirectPropertyBase<T>? _directProperty;
private readonly T _value; private readonly T? _value;
private IDisposable? _subscription; private IDisposable? _subscription;
private bool _isActive; private bool _isActive;
public PropertySetterInstance( public PropertySetterInstance(
IStyleable target, IStyleable target,
StyledPropertyBase<T> property, StyledPropertyBase<T> property,
T value) T? value)
{ {
_target = target; _target = target;
_styledProperty = property; _styledProperty = property;
@ -57,7 +57,7 @@ namespace Avalonia.Styling
{ {
if (_styledProperty is object) if (_styledProperty is object)
{ {
_subscription = _target.SetValue(_styledProperty, _value, BindingPriority.Style); _subscription = _target.SetValue(_styledProperty!, _value, BindingPriority.Style);
} }
else else
{ {

2
src/Avalonia.Styling/Styling/Setter.cs

@ -101,7 +101,7 @@ namespace Avalonia.Styling
data.result = new PropertySetterInstance<T>( data.result = new PropertySetterInstance<T>(
data.target, data.target,
property, property,
(T)data.value!); (T?)data.value);
} }
} }

Loading…
Cancel
Save