public void EndGame()
 {
     if (IsStatisticMod.IsChecked == true)
     {
         ExportStatistic.RaiseEvent(new RoutedEventArgs(MenuItem.ClickEvent));
         RestartStatistic();
         Restart.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
     }
     else
     {
         Pause.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
         MessageBox.Show(Languages.Main.End);
         OpenStatistic.RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
     }
 }