/// <summary> /// This method is used to create the animation for 4 seconds of the wingame text. /// </summary> public void StartAnimation() { double diff = ((_canvasWidth / 10) - (_canvasWidth / 25)) * 2.0; _WinText.FontSize = _canvasWidth / 25; _winAnimation.From = _canvasWidth / 25; _winAnimation.To = _canvasWidth / 15; _WinText.BeginAnimation(TextBlock.FontSizeProperty, _winAnimation); MySolidColorBrush.BeginAnimation(SolidColorBrush.ColorProperty, _colorAnimation); (_WinText.Effect as DropShadowEffect).BeginAnimation(DropShadowEffect.BlurRadiusProperty, shadowAnimation); DoubleAnimation anim = new DoubleAnimation(); anim.FillBehavior = FillBehavior.Stop; anim.Duration = TimeSpan.FromSeconds(2); anim.AutoReverse = true; anim.RepeatBehavior = new RepeatBehavior(2); anim.From = Canvas.GetLeft(this); anim.To = Canvas.GetLeft(this) - diff; this.BeginAnimation(Canvas.LeftProperty, anim); anim.From = Canvas.GetTop(this); anim.To = Canvas.GetTop(this) - diff; this.BeginAnimation(Canvas.TopProperty, anim); }
/// <summary> /// Method used to clear the animation objects after animation is completed. /// </summary> /// <param name="sender">The sender object.</param> /// <param name="e">The event arugments.</param> private void WinAnimation_Completed(object sender, EventArgs e) { _WinText.BeginAnimation(TextBlock.FontSizeProperty, null); MySolidColorBrush.BeginAnimation(SolidColorBrush.ColorProperty, null); (_WinText.Effect as DropShadowEffect).BeginAnimation(DropShadowEffect.BlurRadiusProperty, null); this.BeginAnimation(Canvas.LeftProperty, null); this.BeginAnimation(Canvas.TopProperty, null); }
public IMyLineChart changeSeriesLineColor(string _seriesTitle, string _hexColor) { MySolidColorBrush mySolidColorBrush = new MySolidColorBrush(); foreach (LineSeries aLineSeries in cartesianChart.Series) { if (aLineSeries.Title.Equals(_seriesTitle)) { aLineSeries.Stroke = mySolidColorBrush.convertFromHex(_hexColor); } } return(this); }