using System; using Avalonia.Data; namespace Avalonia.PropertyStore { /// /// Holds values in a set by one of the SetValue or AddBinding /// overloads with non-LocalValue priority. /// internal sealed class ImmediateValueFrame : ValueFrame { public ImmediateValueFrame(BindingPriority priority) : base(priority, FrameType.Style) { } public TypedBindingEntry AddBinding( StyledProperty property, IObservable> source) { var e = new TypedBindingEntry(this, property, source); Add(e); return e; } public TypedBindingEntry AddBinding( StyledProperty property, IObservable source) { var e = new TypedBindingEntry(this, property, source); Add(e); return e; } public SourceUntypedBindingEntry AddBinding( StyledProperty property, IObservable source) { var e = new SourceUntypedBindingEntry(this, property, source); Add(e); return e; } public ImmediateValueEntry AddValue(StyledProperty property, T value) { var e = new ImmediateValueEntry(this, property, value); Add(e); return e; } public void OnEntryDisposed(IValueEntry value) { Remove(value.Property); Owner?.OnValueEntryRemoved(this, value.Property); } protected override bool GetIsActive(out bool hasChanged) { hasChanged = false; return true; } } }