Exemplo n.º 1
0
        /// <summary>
        /// Enlists a dependency property value into this storyboard instance.
        /// </summary>
        /// <param name="dpValue">The dependency property value to enlist.</param>
        /// <param name="animation">The animation to apply to the dependency property.</param>
        internal void Enlist(IDependencyPropertyValue dpValue, AnimationBase animation)
        {
            Contract.Require(dpValue, "dpValue");

            var enlistment = new Enlistment(dpValue, animation);
            enlistedDependencyProperties.Add(enlistment);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Enlists a dependency property value into this storyboard instance.
        /// </summary>
        /// <param name="dpValue">The dependency property value to enlist.</param>
        /// <param name="animation">The animation to apply to the dependency property.</param>
        internal void Enlist(IDependencyPropertyValue dpValue, AnimationBase animation)
        {
            Contract.Require(dpValue, nameof(dpValue));

            var enlistment = new Enlistment(dpValue, animation);

            enlistedDependencyProperties.Add(enlistment);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="DependencyBoundValueConverting{TDependency, TBound}"/> class.
        /// </summary>
        /// <param name="value">The dependency property value which created this object.</param>
        /// <param name="expressionType">The type of the bound expression.</param>
        /// <param name="dataSourceType">The type of the data source.</param>
        /// <param name="expression">The binding expression.</param>
        /// <param name="coerceToString">A value indicating whether to coerce Object values to String values if no valid type conversion exists.</param>
        public DependencyBoundValueConverting(IDependencyPropertyValue value, Type expressionType, Type dataSourceType, String expression, Boolean coerceToString)
            : base(value, expressionType, dataSourceType, expression)
        {
            var expressionFormatString = BindingExpressions.GetBindingFormatStringPart(expression);

            SetFormatString(expressionFormatString);

            this.coerceToString       = coerceToString;
            this.cachedConvertedValue = GetFresh();
        }
Exemplo n.º 4
0
 /// <summary>
 /// Updates the specified dependency property's participation in the digest cycle.
 /// </summary>
 /// <param name="value">The dependency property to update.</param>
 /// <param name="digest">A value indicating whether the dependency property should participate in the digest cycle.</param>
 private void UpdateDigestParticipation(IDependencyPropertyValue value, Boolean digest)
 {
     if (digest)
     {
         if (!digestedDependencyProperties.Contains(value))
         {
             digestedDependencyProperties.Add(value);
         }
     }
     else
     {
         digestedDependencyProperties.Remove(value);
     }
 }
Exemplo n.º 5
0
 /// <summary>
 /// Updates the specified dependency property's participation in the digest cycle.
 /// </summary>
 /// <param name="value">The dependency property to update.</param>
 /// <param name="digest">A value indicating whether the dependency property should participate in the digest cycle.</param>
 private void UpdateDigestParticipation(IDependencyPropertyValue value, Boolean digest)
 {
     if (digest)
     {
         if (!dependencyPropertyValuesNeedingDigestion.Contains(value))
         {
             dependencyPropertyValuesNeedingDigestion.Add(value);
         }
     }
     else
     {
         dependencyPropertyValuesNeedingDigestion.Remove(value);
     }
 }
Exemplo n.º 6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DependencyBoundValue{TDependency}"/> class.
        /// </summary>
        /// <param name="value">The dependency property value which created this object.</param>
        /// <param name="expressionType">The type of the bound expression.</param>
        /// <param name="dataSourceType">The type of the data source.</param>
        /// <param name="expression">The binding expression.</param>
        public DependencyBoundValue(IDependencyPropertyValue value, Type expressionType, Type dataSourceType, String expression)
        {
            this.dependencyValue = value;
            this.getter          = (DataBindingGetter <T>)BindingExpressions.CreateBindingGetter(expressionType, dataSourceType, expression);
            this.setter          = (DataBindingSetter <T>)BindingExpressions.CreateBindingSetter(expressionType, dataSourceType, expression);
            this.comparer        = BindingExpressions.GetComparisonFunction(expressionType);
            this.cachedValue     = GetUnderlyingValue();
            this.dpropReference  = BindingExpressions.GetSimpleDependencyProperty(dataSourceType, expression);

            if (dpropReference != null)
            {
                var dataSource = value.Owner.DependencyDataSource;
                if (dataSource != null)
                {
                    HookDependencyProperty(dataSource);
                }
            }
        }
Exemplo n.º 7
0
        /// <summary>
        /// Removes a dependency property value from the clock's subscriber list.
        /// </summary>
        /// <param name="value">The dependency property value to remove from the subscriber list.</param>
        internal void Unsubscribe(IDependencyPropertyValue value)
        {
            Contract.Require(value, nameof(value));

            subscribers.Remove(value);
        }
Exemplo n.º 8
0
        /// <summary>
        /// Adds a dependency property value to the clock's subscriber list.
        /// </summary>
        /// <param name="value">The dependency property value to add to the subscriber list.</param>
        internal void Subscribe(IDependencyPropertyValue value)
        {
            Contract.Require(value, nameof(value));

            subscribers.AddLast(value);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="DependencyBoundValueNonConverting{TDependency}"/> class.
 /// </summary>
 /// <param name="value">The dependency property value which created this object.</param>
 /// <param name="expressionType">The type of the bound expression.</param>
 /// <param name="dataSourceType">The type of the data source.</param>
 /// <param name="expression">The binding expression.</param>
 public DependencyBoundValueNonConverting(IDependencyPropertyValue value, Type expressionType, Type dataSourceType, String expression)
     : base(value, expressionType, dataSourceType, expression)
 {
 }
Exemplo n.º 10
0
        /// <summary>
        /// Removes a dependency property value from the clock's subscriber list.
        /// </summary>
        /// <param name="value">The dependency property value to remove from the subscriber list.</param>
        internal void Unsubscribe(IDependencyPropertyValue value)
        {
            Contract.Require(value, nameof(value));

            subscribers.Remove(value);
        }
Exemplo n.º 11
0
        /// <summary>
        /// Adds a dependency property value to the clock's subscriber list.
        /// </summary>
        /// <param name="value">The dependency property value to add to the subscriber list.</param>
        internal void Subscribe(IDependencyPropertyValue value)
        {
            Contract.Require(value, nameof(value));

            subscribers.AddLast(value);
        }
Exemplo n.º 12
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Enlistment"/> structure.
 /// </summary>
 /// <param name="dpValue">The dependency property which has been enlisted.</param>
 /// <param name="animation">The animation to apply to the dependency property.</param>
 public Enlistment(IDependencyPropertyValue dpValue, AnimationBase animation)
 {
     this.dpValue   = dpValue;
     this.animation = animation;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="Enlistment"/> structure.
 /// </summary>
 /// <param name="dpValue">The dependency property which has been enlisted.</param>
 /// <param name="animation">The animation to apply to the dependency property.</param>
 public Enlistment(IDependencyPropertyValue dpValue, AnimationBase animation)
 {
     this.dpValue = dpValue;
     this.animation = animation;
 }