コード例 #1
0
 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);
     }
 }
コード例 #2
0
 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);
     });
 }
コード例 #3
0
ファイル: PointAnimation.cs プロジェクト: ndhelix/OpenSilver
        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);
            }
        }
コード例 #4
0
 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);
             }
         }
     });
 }
コード例 #5
0
        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);
        }
コード例 #6
0
        // 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);
        }
コード例 #7
0
 private void UnApply(bool isVisualStateChange)
 {
     AnimationHelpers.ApplyValue(_propertyContainer, _targetProperty, DependencyProperty.UnsetValue, isVisualStateChange);
     //_targetProperty.INTERNAL_PropertySetAnimationValue(_propertyContainer, INTERNAL_NoValue.NoValue);
 }