diff --git a/src/Avalonia.Base/PropertyStore/BindingEntry.cs b/src/Avalonia.Base/PropertyStore/BindingEntry.cs index d86caa250f..078b2b9d2e 100644 --- a/src/Avalonia.Base/PropertyStore/BindingEntry.cs +++ b/src/Avalonia.Base/PropertyStore/BindingEntry.cs @@ -9,14 +9,14 @@ namespace Avalonia.PropertyStore IObserver, IDisposable { - private readonly ValueFrameBase _frame; + private readonly ValueFrame _frame; private readonly IObservable _source; private IDisposable? _subscription; private bool _hasValue; private object? _value; public BindingEntry( - ValueFrameBase frame, + ValueFrame frame, AvaloniaProperty property, IObservable source) { diff --git a/src/Avalonia.Base/PropertyStore/BindingEntry`1.cs b/src/Avalonia.Base/PropertyStore/BindingEntry`1.cs index 8614492c27..224b442378 100644 --- a/src/Avalonia.Base/PropertyStore/BindingEntry`1.cs +++ b/src/Avalonia.Base/PropertyStore/BindingEntry`1.cs @@ -12,14 +12,14 @@ namespace Avalonia.PropertyStore IObserver>, IDisposable { - private readonly ValueFrameBase _frame; + private readonly ValueFrame _frame; private readonly object _source; private IDisposable? _subscription; private bool _hasValue; private T? _value; public BindingEntry( - ValueFrameBase frame, + ValueFrame frame, StyledPropertyBase property, IObservable> source) { @@ -29,7 +29,7 @@ namespace Avalonia.PropertyStore } public BindingEntry( - ValueFrameBase frame, + ValueFrame frame, StyledPropertyBase property, IObservable source) { diff --git a/src/Avalonia.Base/PropertyStore/IValueEntry.cs b/src/Avalonia.Base/PropertyStore/IValueEntry.cs index 43709fe115..3dd9497c14 100644 --- a/src/Avalonia.Base/PropertyStore/IValueEntry.cs +++ b/src/Avalonia.Base/PropertyStore/IValueEntry.cs @@ -3,7 +3,7 @@ namespace Avalonia.PropertyStore { /// - /// Represents an untyped value entry in an . + /// Represents an untyped value entry in a . /// internal interface IValueEntry { diff --git a/src/Avalonia.Base/PropertyStore/IValueEntry`1.cs b/src/Avalonia.Base/PropertyStore/IValueEntry`1.cs index b52ca4815b..7814261c91 100644 --- a/src/Avalonia.Base/PropertyStore/IValueEntry`1.cs +++ b/src/Avalonia.Base/PropertyStore/IValueEntry`1.cs @@ -1,7 +1,7 @@ namespace Avalonia.PropertyStore { /// - /// Represents a typed value entry in an . + /// Represents a typed value entry in a . /// internal interface IValueEntry : IValueEntry { diff --git a/src/Avalonia.Base/PropertyStore/IValueFrame.cs b/src/Avalonia.Base/PropertyStore/IValueFrame.cs deleted file mode 100644 index 99338a4720..0000000000 --- a/src/Avalonia.Base/PropertyStore/IValueFrame.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System; -using System.Diagnostics.CodeAnalysis; -using Avalonia.Data; - -namespace Avalonia.PropertyStore -{ - /// - /// Represents a collection of property values in a . - /// - /// - /// A value frame is an abstraction over the following sources of values in an - /// : - /// - /// - A style - /// - Local values - /// - Animation values - /// - internal interface IValueFrame : IDisposable - { - /// - /// Gets the number of value entries in the frame. - /// - int EntryCount { get; } - - /// - /// Gets a value indicating whether the frame is active. - /// - bool IsActive { get; } - - /// - /// Gets the value store that owns the frame. - /// - ValueStore? Owner { get; } - - /// - /// Gets the frame's priority. - /// - BindingPriority Priority { get; } - - /// - /// Retreives the frame's value entry with the specified index. - /// - IValueEntry GetEntry(int index); - - /// - /// Sets the owner of the value frame. - /// - /// The new owner. - void SetOwner(ValueStore? owner); - - /// - /// Tries to retreive the frame's value entry for the specified property. - /// - bool TryGetEntry(AvaloniaProperty property, [NotNullWhen(true)] out IValueEntry? entry); - } -} diff --git a/src/Avalonia.Base/PropertyStore/ImmediateValueFrame.cs b/src/Avalonia.Base/PropertyStore/ImmediateValueFrame.cs index 94d357ffe4..35cf6465d0 100644 --- a/src/Avalonia.Base/PropertyStore/ImmediateValueFrame.cs +++ b/src/Avalonia.Base/PropertyStore/ImmediateValueFrame.cs @@ -7,7 +7,7 @@ namespace Avalonia.PropertyStore /// Holds values in a set by one of the SetValue or AddBinding /// overloads with non-LocalValue priority. /// - internal class ImmediateValueFrame : ValueFrameBase + internal class ImmediateValueFrame : ValueFrame { public ImmediateValueFrame(BindingPriority priority) { diff --git a/src/Avalonia.Base/PropertyStore/UntypedBindingEntry.cs b/src/Avalonia.Base/PropertyStore/UntypedBindingEntry.cs index 82c5ff6c1a..e15d455a44 100644 --- a/src/Avalonia.Base/PropertyStore/UntypedBindingEntry.cs +++ b/src/Avalonia.Base/PropertyStore/UntypedBindingEntry.cs @@ -10,14 +10,14 @@ namespace Avalonia.PropertyStore IObserver, IDisposable { - private readonly ValueFrameBase _frame; + private readonly ValueFrame _frame; private readonly IObservable _source; private IDisposable? _subscription; private bool _hasValue; private T? _value; public UntypedBindingEntry( - ValueFrameBase frame, + ValueFrame frame, StyledPropertyBase property, IObservable source) { diff --git a/src/Avalonia.Base/PropertyStore/ValueFrameBase.cs b/src/Avalonia.Base/PropertyStore/ValueFrame.cs similarity index 96% rename from src/Avalonia.Base/PropertyStore/ValueFrameBase.cs rename to src/Avalonia.Base/PropertyStore/ValueFrame.cs index 09e37e7503..236b602e70 100644 --- a/src/Avalonia.Base/PropertyStore/ValueFrameBase.cs +++ b/src/Avalonia.Base/PropertyStore/ValueFrame.cs @@ -5,7 +5,7 @@ using Avalonia.Utilities; namespace Avalonia.PropertyStore { - internal abstract class ValueFrameBase : IValueFrame + internal abstract class ValueFrame { private readonly AvaloniaPropertyValueStore _entries = new(); diff --git a/src/Avalonia.Base/PropertyStore/ValueStore.cs b/src/Avalonia.Base/PropertyStore/ValueStore.cs index aa24ce880e..fe47f06d89 100644 --- a/src/Avalonia.Base/PropertyStore/ValueStore.cs +++ b/src/Avalonia.Base/PropertyStore/ValueStore.cs @@ -11,7 +11,7 @@ namespace Avalonia.PropertyStore { internal class ValueStore { - private readonly List _frames = new(); + private readonly List _frames = new(); private Dictionary? _localValueBindings; private Dictionary? _effectiveValues; private int _inheritedValueCount; @@ -22,7 +22,7 @@ namespace Avalonia.PropertyStore public AvaloniaObject Owner { get; } public ValueStore? InheritanceAncestor { get; private set; } - public IReadOnlyList Frames => _frames; + public IReadOnlyList Frames => _frames; public void BeginStyling() => ++_styling; @@ -32,7 +32,7 @@ namespace Avalonia.PropertyStore ReevaluateEffectiveValues(); } - public void AddFrame(IValueFrame style) + public void AddFrame(ValueFrame style) { InsertFrame(style); ReevaluateEffectiveValues(); @@ -366,7 +366,7 @@ namespace Avalonia.PropertyStore /// /// The previously bound property. /// The frame which contained the binding. - public void OnBindingCompleted(AvaloniaProperty property, IValueFrame frame) + public void OnBindingCompleted(AvaloniaProperty property, ValueFrame frame) { var priority = frame.Priority; @@ -378,11 +378,11 @@ namespace Avalonia.PropertyStore } /// - /// Called by an when its + /// Called by a when its /// state changes. /// /// The frame which produced the change. - public void OnFrameActivationChanged(IValueFrame frame) + public void OnFrameActivationChanged(ValueFrame frame) { ReevaluateEffectiveValues(); } @@ -523,12 +523,12 @@ namespace Avalonia.PropertyStore } /// - /// Called by an to re-evaluate the effective value when a value + /// Called by a to re-evaluate the effective value when a value /// is removed. /// /// The frame on which the change occurred. /// The property whose value was removed. - public void OnValueEntryRemoved(IValueFrame frame, AvaloniaProperty property) + public void OnValueEntryRemoved(ValueFrame frame, AvaloniaProperty property) { Debug.Assert(frame.IsActive); @@ -548,7 +548,7 @@ namespace Avalonia.PropertyStore } } - public bool RemoveFrame(IValueFrame frame) + public bool RemoveFrame(ValueFrame frame) { if (_frames.Remove(frame)) { @@ -570,7 +570,7 @@ namespace Avalonia.PropertyStore null); } - private void InsertFrame(IValueFrame frame) + private void InsertFrame(ValueFrame frame) { Debug.Assert(!_frames.Contains(frame)); diff --git a/src/Avalonia.Base/Styling/StyleBase.cs b/src/Avalonia.Base/Styling/StyleBase.cs index a6eb938d5b..5e6cc650a4 100644 --- a/src/Avalonia.Base/Styling/StyleBase.cs +++ b/src/Avalonia.Base/Styling/StyleBase.cs @@ -81,7 +81,7 @@ namespace Avalonia.Styling return _resources?.TryGetResource(key, out result) ?? false; } - internal IValueFrame Attach(IStyleable target, IStyleActivator? activator) + internal ValueFrame Attach(IStyleable target, IStyleActivator? activator) { if (target is not AvaloniaObject ao) throw new InvalidOperationException("Styles can only be applied to AvaloniaObjects."); diff --git a/src/Avalonia.Base/Styling/StyleInstance.cs b/src/Avalonia.Base/Styling/StyleInstance.cs index a6ca2421cd..5f1c3e8c3a 100644 --- a/src/Avalonia.Base/Styling/StyleInstance.cs +++ b/src/Avalonia.Base/Styling/StyleInstance.cs @@ -10,13 +10,13 @@ namespace Avalonia.Styling /// Stores state for a that has been instanced on a control. /// /// - /// implements the interface meaning that - /// it is injected directly into the value store of an . Depending - /// on the setters present on the style, it may be possible to share a single style instance - /// among all controls that the style is applied to; meaning that a single style instance can + /// is based on meaning that it is + /// injected directly into the value store of an . Depending on + /// the setters present on the style, it may be possible to share a single style instance + /// among all controls that the style is applied to, meaning that a single style instance can /// apply to multiple controls. /// - internal class StyleInstance : ValueFrameBase, IStyleInstance, IStyleActivatorSink, IDisposable + internal class StyleInstance : ValueFrame, IStyleInstance, IStyleActivatorSink, IDisposable { private readonly IStyleActivator? _activator; private List? _setters;