Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PriorityLevel"/> class.
        /// </summary>
        /// <param name="owner">The owner.</param>
        /// <param name="priority">The priority.</param>
        public PriorityLevel(
            PriorityValue owner,
            int priority)
        {
            Contract.Requires<ArgumentNullException>(owner != null);

            _owner = owner;
            Priority = priority;
            Value = _directValue = AvaloniaProperty.UnsetValue;
            ActiveBindingIndex = -1;
            Bindings = new LinkedList<PriorityBindingEntry>();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PriorityLevel"/> class.
        /// </summary>
        /// <param name="owner">The owner.</param>
        /// <param name="priority">The priority.</param>
        public PriorityLevel(
            PriorityValue owner,
            int priority)
        {
            Contract.Requires <ArgumentNullException>(owner != null);

            _owner             = owner;
            Priority           = priority;
            Value              = _directValue = AvaloniaProperty.UnsetValue;
            ActiveBindingIndex = -1;
            Bindings           = new LinkedList <PriorityBindingEntry>();
        }
Exemplo n.º 3
0
        /// <summary>
        /// Creates a <see cref="PriorityValue"/> for a <see cref="AvaloniaProperty"/>.
        /// </summary>
        /// <param name="property">The property.</param>
        /// <returns>The <see cref="PriorityValue"/>.</returns>
        private PriorityValue CreatePriorityValue(AvaloniaProperty property)
        {
            var validate = ((IStyledPropertyAccessor)property).GetValidationFunc(GetType());
            Func <object, object> validate2 = null;

            if (validate != null)
            {
                validate2 = v => validate(this, v);
            }

            PriorityValue result = new PriorityValue(
                this,
                property,
                property.PropertyType,
                validate2);

            return(result);
        }
Exemplo n.º 4
0
 /// <inheritdoc/>
 void IPriorityValueOwner.BindingNotificationReceived(PriorityValue sender, BindingNotification notification)
 {
     UpdateDataValidation(sender.Property, notification);
 }
Exemplo n.º 5
0
        /// <inheritdoc/>
        void IPriorityValueOwner.DataValidationChanged(PriorityValue sender, IValidationStatus status)
        {
            var property = sender.Property;

            DataValidationChanged(property, status);
        }