Browse Source

Remove unneeded method.

pull/8600/head
Steven Kirk 3 years ago
parent
commit
e44d902374
  1. 7
      src/Avalonia.Base/PropertyStore/BindingEntryBase.cs
  2. 12
      src/Avalonia.Base/PropertyStore/IValueEntry.cs
  3. 6
      src/Avalonia.Base/PropertyStore/ImmediateValueEntry.cs
  4. 12
      src/Avalonia.Base/Styling/PropertySetterTemplateInstance.cs
  5. 6
      src/Avalonia.Base/Styling/Setter.cs

7
src/Avalonia.Base/PropertyStore/BindingEntryBase.cs

@ -79,13 +79,6 @@ namespace Avalonia.PropertyStore
return _value!;
}
bool IValueEntry.TryGetValue(out object? value)
{
Start(produceValue: false);
value = _value;
return _hasValue;
}
protected abstract BindingValue<TValue> ConvertAndValidate(TSource value);
protected abstract BindingValue<TValue> ConvertAndValidate(BindingValue<TSource> value);

12
src/Avalonia.Base/PropertyStore/IValueEntry.cs

@ -22,18 +22,6 @@ namespace Avalonia.PropertyStore
/// </exception>
object? GetValue();
/// <summary>
/// Tries to get the value associated with the entry.
/// </summary>
/// <param name="value">
/// When this method returns, contains the value associated with the entry if a value is
/// present; otherwise, returns null.
/// </param>
/// <returns>
/// true if the entry has an associated value; otherwise false.
/// </returns>
bool TryGetValue(out object? value);
/// <summary>
/// Called when the value entry is removed from the value store.
/// </summary>

6
src/Avalonia.Base/PropertyStore/ImmediateValueEntry.cs

@ -21,12 +21,6 @@ namespace Avalonia.PropertyStore
public bool HasValue => true;
AvaloniaProperty IValueEntry.Property => Property;
public bool TryGetValue(out object? value)
{
value = _value;
return true;
}
public void Unsubscribe() { }
public void Dispose() => _owner.OnEntryDisposed(this);

12
src/Avalonia.Base/Styling/PropertySetterTemplateInstance.cs

@ -17,17 +17,7 @@ namespace Avalonia.Styling
public bool HasValue => true;
public AvaloniaProperty Property { get; }
public object? GetValue()
{
TryGetValue(out var value);
return value;
}
public bool TryGetValue(out object? value)
{
value = _value ??= _template.Build();
return value != AvaloniaProperty.UnsetValue;
}
public object? GetValue() => _value ??= _template.Build();
void IValueEntry.Unsubscribe() { }
}

6
src/Avalonia.Base/Styling/Setter.cs

@ -88,12 +88,6 @@ namespace Avalonia.Styling
object? IValueEntry.GetValue() => Value;
bool IValueEntry.TryGetValue(out object? value)
{
value = Value;
return true;
}
private AvaloniaProperty EnsureProperty()
{
return Property ?? throw new InvalidOperationException("Setter.Property must be set.");

Loading…
Cancel
Save