private void ApplyLastKeyFrame(object sender, EventArgs e) { if (!_cancelledAnimation) { DoubleKeyFrame lastKeyFrame = _keyFrames[_resolvedKeyFrames.GetNextKeyFrameIndex(_keyFrames.Count - 1)]; AnimationHelpers.ApplyValue(_propertyContainer, _targetProperty, lastKeyFrame.Value, _parameters.IsVisualStateChange); } }
private Action OnAnimationCompleted(IterationParameters parameters, bool isLastLoop, object value, DependencyObject target, PropertyPath propertyPath, Guid callBackGuid) { return(() => { if (isLastLoop && _animationID == callBackGuid) { AnimationHelpers.ApplyValue(target, propertyPath, value, parameters.IsVisualStateChange); } OnIterationCompleted(parameters); }); }
private void OnAnimationCompleted(IterationParameters parameters, bool isLastLoop, object value, DependencyObject target, PropertyPath propertyPath) { if (!this._isUnapplied) { if (isLastLoop) { AnimationHelpers.ApplyValue(target, propertyPath, value, parameters.IsVisualStateChange); } OnIterationCompleted(parameters); } }
private Action OnKeyFrameCompleted(IterationParameters parameters, bool isLastLoop, object value, DependencyObject target, PropertyPath propertyPath, Guid callBackGuid) { return(() => { if (_animationID == callBackGuid) { AnimationHelpers.ApplyValue(target, propertyPath, value, parameters.IsVisualStateChange); _appliedKeyFramesCount++; if (!CheckTimeLineEndAndRaiseCompletedEvent(_parameters)) { ApplyKeyFrame(GetNextKeyFrame(), isLastLoop); } } }); }
private void ApplyKeyFrame(ObjectKeyFrame keyFrame) { object value = keyFrame.Value; if (value is string && _propDp.PropertyType != typeof(string)) { if (_propDp.PropertyType.IsEnum) { value = Enum.Parse(_propDp.PropertyType, (string)value); } else { value = DotNetForHtml5.Core.TypeFromStringConverters.ConvertFromInvariantString(_propDp.PropertyType, (string)value); } } object castedValue = DynamicCast(value, _propDp.PropertyType); AnimationHelpers.ApplyValue(_propertyContainer, _targetProperty, castedValue, _parameters.IsVisualStateChange); }
// todo: find a way to not have to do this. private void SetInitialAnimationValue(bool isVisualStateChange) { object initialAnimationValue = _propertyContainer.GetValue(_propDp); AnimationHelpers.ApplyValue(_propertyContainer, _targetProperty, initialAnimationValue, isVisualStateChange); }
private void UnApply(bool isVisualStateChange) { AnimationHelpers.ApplyValue(_propertyContainer, _targetProperty, DependencyProperty.UnsetValue, isVisualStateChange); //_targetProperty.INTERNAL_PropertySetAnimationValue(_propertyContainer, INTERNAL_NoValue.NoValue); }