예제 #1
0
파일: Clippy.cs 프로젝트: xet7/ClippyVS
        /// <summary>
        /// Start a specific animation
        /// </summary>
        /// <param name="animationType"></param>
        public void StartAnimation(ClippyAnimations animationType, bool byPassCurrentAnimation = false)
        {
            System.Windows.Application.Current.MainWindow.Dispatcher.Invoke(new Action(() =>
            {
                if (!IsAnimating || byPassCurrentAnimation)
                {
                    IsAnimating = true;

                    clippedImage.BeginAnimation(Canvas.LeftProperty, Animations[animationType.ToString()].Item1);
                    clippedImage.BeginAnimation(Canvas.TopProperty, Animations[animationType.ToString()].Item2);
                }
            }), DispatcherPriority.Send);
        }
예제 #2
0
 /// <summary>
 /// Start a specific animation
 /// </summary>
 /// <param name="animationType"></param>
 public void StartAnimation(ClippyAnimations animationType, bool byPassCurrentAnimation = false)
 {
     clippedImage.BeginAnimation(Canvas.LeftProperty, Animations[animationType.ToString()].Item1);
     clippedImage.BeginAnimation(Canvas.TopProperty, Animations[animationType.ToString()].Item2);
 }