private void ShowLastButton_Click(object sender, RoutedEventArgs e)
        {
            var last = MultipleSerieses ? AnimationSeries.Count - 1 : Moving.Count - 1;

            PlotAnimation.CurrentIteration = last;
            PlotAnimation.Pause();
        }
 public ChartWindow(List <List <Series> > animationSeries)
 {
     InitializeComponent();
     PlotAnimation        = new PlotAnimation(Plot);
     Plot.TitleFontSize   = 24;
     Plot.TitleFontWeight = FontWeights.ExtraBold;
     Plot.IsLegendVisible = false;
     AnimationSeries      = animationSeries;
     MultipleSerieses     = true;
 }
 public ChartWindow(Series stat, List <Series> animationSeries)
 {
     InitializeComponent();
     Plot.TitleFontSize   = 24;
     Plot.TitleFontWeight = FontWeights.ExtraBold;
     PlotAnimation        = new PlotAnimation(Plot);
     Stat             = stat;
     Moving           = animationSeries;
     MultipleSerieses = false;
 }
 private void PauseButton_Click(object sender, RoutedEventArgs e)
 {
     if (PlotAnimation.IsRunning)
     {
         PlotAnimation.Pause();
     }
     else
     {
         PlotAnimation.Resume();
     }
 }
 private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs eventArgs)
 {
     try
     {
         PlotAnimation.End();
     }
     catch (ThreadAbortException e)
     {
         Debug.WriteLine(e.Message);
     }
 }
 private void RunAnimationButton_Click(object sender, RoutedEventArgs e)
 {
     if (!PlotAnimation.IsRunning)
     {
         try
         {
             int speed = Int32.Parse(SpeedInMiliseconds.Text);
             if (MultipleSerieses)
             {
                 PlotAnimation.RunMultipleSeries(speed, AnimationSeries);
             }
             else
             {
                 PlotAnimation.RunMultipleAnimationsWithOneStatic(speed, Stat, Moving);
             }
         }
         catch (Exception ex)
         {
             MessageBox.Show($"Something went wrong while starting animation. Original message: {ex.Message}");
         }
     }
 }
 private void ShowFirstButton_Click(object sender, RoutedEventArgs e)
 {
     PlotAnimation.CurrentIteration = 0;
     PlotAnimation.Pause();
 }