using ClassLibraryStandard;
using EntitiesStandard;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace UI
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();

           
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            BindingList<Participant> list01 = new BindingList<Participant>();

            Participant pr3 = new Participant();
            pr3.name = "Hans3";
            pr3.lastname = "Wurst3";
            list01.Add(pr3);

            Participant pr4 = new Participant();
            pr3.name = "Hans4";
            pr3.lastname = "Wurst4";
            list01.Add(pr4);

            

            List<Participant> listpar = new List<Participant>();

            

           
               // Thread.Sleep(2000);


                try
                {
                    listpar = XMLhelper.xmlToDeserialize<List<Participant>>();
                }
                catch (Exception exception)
                {
                    Console.WriteLine(exception);
                //throw;
                Thread.Sleep(200);
            }
              


                foreach (var par in listpar)
                {
                    list01.Add(par);
                    datagrid1.ItemsSource = list01;
                }
            }
        
    }
}
