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