private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            DataBase.TablesModel tables = new DataBase.TablesModel();
            AllTables = tables.SelectAll();
            TablesList.ItemsSource = AllTables.DefaultView;

            DispatcherTimer dTimer = new System.Windows.Threading.DispatcherTimer();

            dTimer.Tick += new EventHandler(dTimer_Tick);

            dTimer.Interval = new TimeSpan(0, 0, 1);

            dTimer.Start();
        }
 private void AddButton_Click(object sender, RoutedEventArgs e)
 {
     DataRow row = TableDataTable.NewRow();
     AddWindow add = new AddWindow();
     add.DataContext = row;
     if (add.ShowDialog().Value)
     {
         TableDataTable.Rows.Add(row);
         DataBase.TablesModel tables = new DataBase.TablesModel();
         tables.AddTable(TableDataTable);
         TableDataTable.Clear();
         TableDataTable = tables.SelectAll();
         TablesList.ItemsSource = TableDataTable.DefaultView;
     }
 }
 private void dTimer_Tick(object sender, EventArgs e)
 {
     DataBase.TablesModel tables = new DataBase.TablesModel();
     AllTables = tables.SelectAll();
     TablesList.ItemsSource = AllTables.DefaultView;
 }
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     DataBase.TablesModel tables = new DataBase.TablesModel();
     TableDataTable =tables.SelectAll();
     TablesList.ItemsSource = TableDataTable.DefaultView;
 }