/// <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); }
/// <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(); }
/// <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); } }
/// <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); } }
/// <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); } } }
/// <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); }
/// <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) { }
/// <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; }