コード例 #1
0
        public PriorityValue(
            IAvaloniaObject owner,
            StyledPropertyBase <T> property,
            IValueSink sink,
            IPriorityValueEntry <T> existing)
            : this(owner, property, sink)
        {
            existing.Reparent(this);
            _entries.Add(existing);

            if (existing is IBindingEntry binding &&
                existing.Priority == BindingPriority.LocalValue)
            {
                // Bit of a special case here: if we have a local value binding that is being
                // promoted to a priority value we need to make sure the binding is subscribed
                // even if we've got a batch operation in progress because otherwise we don't know
                // whether the binding or a subsequent SetValue with local priority will win. A
                // notification won't be sent during batch update anyway because it will be
                // caught and stored for later by the ValueStore.
                binding.Start(ignoreBatchUpdate: true);
            }

            var v = existing.GetValue();

            if (v.HasValue)
            {
                _value   = v;
                Priority = existing.Priority;
            }
        }
コード例 #2
0
 void IValueSink.Completed <T>(
     StyledPropertyBase <T> property,
     IPriorityValueEntry entry,
     Optional <T> oldValue)
 {
     ((IValueSink)this).ValueChanged(property, BindingPriority.Unset, oldValue, default);
 }
コード例 #3
0
ファイル: PriorityValue.cs プロジェクト: nirzaf/Avalonia
 void IValueSink.Completed <TValue>(
     StyledPropertyBase <TValue> property,
     IPriorityValueEntry entry,
     Optional <TValue> oldValue)
 {
     _entries.Remove((IPriorityValueEntry <T>)entry);
     UpdateEffectiveValue();
 }
コード例 #4
0
 public void Completed(StyledPropertyBase <T> property, IPriorityValueEntry entry, Optional <T> oldValue)
 {
     if (_store is not null)
     {
         _store?.Completed(property, entry, oldValue);
     }
     else
     {
         _priorityValue !.Completed(entry, oldValue);
     }
 }
コード例 #5
0
ファイル: PriorityValue.cs プロジェクト: kisslike/Avalonia
        public PriorityValue(
            IAvaloniaObject owner,
            StyledPropertyBase <T> property,
            IValueSink sink,
            IPriorityValueEntry <T> existing)
            : this(owner, property, sink)
        {
            existing.Reparent(this);
            _entries.Add(existing);

            if (existing.Value.HasValue)
            {
                Value         = existing.Value;
                ValuePriority = existing.Priority;
            }
        }
コード例 #6
0
ファイル: AvaloniaObject.cs プロジェクト: josegomez/Avalonia
 void IValueSink.Completed(AvaloniaProperty property, IPriorityValueEntry entry)
 {
 }
コード例 #7
0
ファイル: PriorityValue.cs プロジェクト: kisslike/Avalonia
 void IValueSink.Completed(AvaloniaProperty property, IPriorityValueEntry entry)
 {
     _entries.Remove((IPriorityValueEntry <T>)entry);
     UpdateEffectiveValue();
 }
コード例 #8
0
 public void Completed <T>(StyledPropertyBase <T> property, IPriorityValueEntry entry, Optional <T> oldValue)
 {
 }