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; } }
void IValueSink.Completed <TValue>( StyledPropertyBase <TValue> property, IPriorityValueEntry entry, Optional <TValue> oldValue) { _entries.Remove((IPriorityValueEntry <T>)entry); UpdateEffectiveValue(); }
public PropertySetterInstance( IStyleable target, StyledPropertyBase <T> property, T value) { _target = target; _styledProperty = property; _value = value; }
public PropertySetterTemplateInstance( IStyleable target, StyledPropertyBase <T> property, ITemplate template) { _target = target; _styledProperty = property; _template = template; }
public ConstantValueEntry( StyledPropertyBase <T> property, T value, BindingPriority priority) { Property = property; Value = value; Priority = priority; }
public PropertySetterLazyInstance( IStyleable target, StyledPropertyBase <T> property, Func <T> valueFactory) { _target = target; _styledProperty = property; _valueFactory = valueFactory; }
public PriorityValue( IAvaloniaObject owner, StyledPropertyBase <T> property, IValueSink sink, LocalValueEntry <T> existing) : this(owner, property, sink) { _value = _localValue = existing.GetValue(BindingPriority.LocalValue); Priority = BindingPriority.LocalValue; }
public ConstantValueEntry( StyledPropertyBase <T> property, [AllowNull] T value, BindingPriority priority, IValueSink sink) { Property = property; _value = value; Priority = priority; _sink = sink; }
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); } }
public ConstantValueEntry( StyledPropertyBase <T> property, Optional <T> value, BindingPriority priority, IValueSink sink) { Property = property; _value = value; Priority = priority; _sink = sink; }
public ConstantValueEntry( StyledPropertyBase <T> property, T value, BindingPriority priority, ValueOwner <T> sink) { Property = property; _value = value; Priority = priority; _sink = sink; }
void IValueSink.ValueChanged <TValue>( StyledPropertyBase <TValue> property, BindingPriority priority, Optional <TValue> oldValue, BindingValue <TValue> newValue) { if (priority == BindingPriority.LocalValue) { _localValue = default; } UpdateEffectiveValue(); }
public BindingEntry( IAvaloniaObject owner, StyledPropertyBase <T> property, IObservable <BindingValue <T> > source, BindingPriority priority, IValueSink sink) { _owner = owner; Property = property; Source = source; Priority = priority; _sink = sink; }
public PriorityValue( AvaloniaObject owner, StyledPropertyBase <T> property, ValueStore store) { _owner = owner; Property = property; _store = store; if (property.HasCoercion) { var metadata = property.GetMetadata(owner.GetType()); _coerceValue = metadata.CoerceValue; } }
public PriorityValue( IAvaloniaObject owner, StyledPropertyBase <T> property, IValueSink sink) { _owner = owner; Property = property; _sink = sink; if (property.HasCoercion) { var metadata = property.GetMetadata(owner.GetType()); _coerceValue = metadata.CoerceValue; } }
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; } }
public PropertySetterBindingInstance( IStyleable target, StyledPropertyBase <T> property, IBinding binding) { _target = target; _styledProperty = property; _binding = binding.Initiate(_target, property); if (_binding.Mode == BindingMode.OneTime) { // For the moment, we don't support OneTime bindings in setters, because I'm not // sure what the semantics should be in the case of activation/deactivation. throw new NotSupportedException("OneTime bindings are not supported in setters."); } _inner = new Inner(this); }
public void Completed <T>(StyledPropertyBase <T> property, IPriorityValueEntry entry, Optional <T> oldValue) { }