From 270f9718b835b51c2d88ea2e2bf353c314fee2df Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Mon, 20 Jan 2020 10:54:13 +0100 Subject: [PATCH] Removed unused field. --- .../PropertyStore/PriorityValue.cs | 9 ++------ src/Avalonia.Base/ValueStore.cs | 8 +++---- .../PriorityValueTests.cs | 21 ++++++++----------- 3 files changed, 15 insertions(+), 23 deletions(-) diff --git a/src/Avalonia.Base/PropertyStore/PriorityValue.cs b/src/Avalonia.Base/PropertyStore/PriorityValue.cs index 640570237d..5f117b26cf 100644 --- a/src/Avalonia.Base/PropertyStore/PriorityValue.cs +++ b/src/Avalonia.Base/PropertyStore/PriorityValue.cs @@ -8,27 +8,23 @@ namespace Avalonia.PropertyStore { internal class PriorityValue : IValue, IValueSink { - private readonly IAvaloniaObject _owner; private readonly IValueSink _sink; private readonly List> _entries = new List>(); private Optional _localValue; public PriorityValue( - IAvaloniaObject owner, StyledPropertyBase property, IValueSink sink) { - _owner = owner; Property = property; _sink = sink; } public PriorityValue( - IAvaloniaObject owner, StyledPropertyBase property, IValueSink sink, IPriorityValueEntry existing) - : this(owner, property, sink) + : this(property, sink) { existing.Reparent(this); _entries.Add(existing); @@ -41,11 +37,10 @@ namespace Avalonia.PropertyStore } public PriorityValue( - IAvaloniaObject owner, StyledPropertyBase property, IValueSink sink, LocalValueEntry existing) - : this(owner, property, sink) + : this(property, sink) { _localValue = existing.Value; Value = _localValue; diff --git a/src/Avalonia.Base/ValueStore.cs b/src/Avalonia.Base/ValueStore.cs index 23adfb4c93..c0e704b6cc 100644 --- a/src/Avalonia.Base/ValueStore.cs +++ b/src/Avalonia.Base/ValueStore.cs @@ -174,7 +174,7 @@ namespace Avalonia { if (slot is IPriorityValueEntry e) { - var priorityValue = new PriorityValue(_owner, property, this, e); + var priorityValue = new PriorityValue(property, this, e); _values.SetValue(property, priorityValue); priorityValue.SetValue(value, priority); } @@ -192,7 +192,7 @@ namespace Avalonia } else { - var priorityValue = new PriorityValue(_owner, property, this, l); + var priorityValue = new PriorityValue(property, this, l); _values.SetValue(property, priorityValue); } } @@ -212,7 +212,7 @@ namespace Avalonia if (slot is IPriorityValueEntry e) { - priorityValue = new PriorityValue(_owner, property, this, e); + priorityValue = new PriorityValue(property, this, e); } else if (slot is PriorityValue p) { @@ -220,7 +220,7 @@ namespace Avalonia } else if (slot is LocalValueEntry l) { - priorityValue = new PriorityValue(_owner, property, this, l); + priorityValue = new PriorityValue(property, this, l); } else { diff --git a/tests/Avalonia.Base.UnitTests/PriorityValueTests.cs b/tests/Avalonia.Base.UnitTests/PriorityValueTests.cs index 8c76445645..9f69c42e52 100644 --- a/tests/Avalonia.Base.UnitTests/PriorityValueTests.cs +++ b/tests/Avalonia.Base.UnitTests/PriorityValueTests.cs @@ -21,7 +21,6 @@ namespace Avalonia.Base.UnitTests public void Constructor_Should_Set_Value_Based_On_Initial_Entry() { var target = new PriorityValue( - Owner, TestProperty, NullSink, new ConstantValueEntry(TestProperty, "1", BindingPriority.StyleTrigger)); @@ -34,7 +33,6 @@ namespace Avalonia.Base.UnitTests public void SetValue_LocalValue_Should_Not_Add_Entries() { var target = new PriorityValue( - Owner, TestProperty, NullSink); @@ -48,7 +46,6 @@ namespace Avalonia.Base.UnitTests public void SetValue_Non_LocalValue_Should_Add_Entries() { var target = new PriorityValue( - Owner, TestProperty, NullSink); @@ -66,7 +63,7 @@ namespace Avalonia.Base.UnitTests [Fact] public void Binding_With_Same_Priority_Should_Be_Appended() { - var target = new PriorityValue(Owner, TestProperty, NullSink); + var target = new PriorityValue(TestProperty, NullSink); var source1 = new Source("1"); var source2 = new Source("2"); @@ -86,7 +83,7 @@ namespace Avalonia.Base.UnitTests [Fact] public void Binding_With_Higher_Priority_Should_Be_Appended() { - var target = new PriorityValue(Owner, TestProperty, NullSink); + var target = new PriorityValue(TestProperty, NullSink); var source1 = new Source("1"); var source2 = new Source("2"); @@ -106,7 +103,7 @@ namespace Avalonia.Base.UnitTests [Fact] public void Binding_With_Lower_Priority_Should_Be_Prepended() { - var target = new PriorityValue(Owner, TestProperty, NullSink); + var target = new PriorityValue(TestProperty, NullSink); var source1 = new Source("1"); var source2 = new Source("2"); @@ -126,7 +123,7 @@ namespace Avalonia.Base.UnitTests [Fact] public void Second_Binding_With_Lower_Priority_Should_Be_Inserted_In_Middle() { - var target = new PriorityValue(Owner, TestProperty, NullSink); + var target = new PriorityValue(TestProperty, NullSink); var source1 = new Source("1"); var source2 = new Source("2"); var source3 = new Source("3"); @@ -148,7 +145,7 @@ namespace Avalonia.Base.UnitTests [Fact] public void Competed_Binding_Should_Be_Removed() { - var target = new PriorityValue(Owner, TestProperty, NullSink); + var target = new PriorityValue(TestProperty, NullSink); var source1 = new Source("1"); var source2 = new Source("2"); var source3 = new Source("3"); @@ -171,7 +168,7 @@ namespace Avalonia.Base.UnitTests [Fact] public void Value_Should_Come_From_Last_Entry() { - var target = new PriorityValue(Owner, TestProperty, NullSink); + var target = new PriorityValue(TestProperty, NullSink); var source1 = new Source("1"); var source2 = new Source("2"); var source3 = new Source("3"); @@ -186,7 +183,7 @@ namespace Avalonia.Base.UnitTests [Fact] public void LocalValue_Should_Override_LocalValue_Binding() { - var target = new PriorityValue(Owner, TestProperty, NullSink); + var target = new PriorityValue(TestProperty, NullSink); var source1 = new Source("1"); target.AddBinding(source1, BindingPriority.LocalValue).Start(); @@ -198,7 +195,7 @@ namespace Avalonia.Base.UnitTests [Fact] public void LocalValue_Should_Override_Style_Binding() { - var target = new PriorityValue(Owner, TestProperty, NullSink); + var target = new PriorityValue(TestProperty, NullSink); var source1 = new Source("1"); target.AddBinding(source1, BindingPriority.Style).Start(); @@ -210,7 +207,7 @@ namespace Avalonia.Base.UnitTests [Fact] public void LocalValue_Should_Not_Override_Animation_Binding() { - var target = new PriorityValue(Owner, TestProperty, NullSink); + var target = new PriorityValue(TestProperty, NullSink); var source1 = new Source("1"); target.AddBinding(source1, BindingPriority.Animation).Start();