public MainWindow() { InitializeComponent(); TablesComboBox.ItemsSource = DataBaseSupport.GetTables(); TablesComboBox.SelectedIndex = 0; //TitelsText.ItemsSource = GetTitles(TablesComboBox.Text); }
private void TitlesListBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { TablesComboBox.ItemsSource = DataBaseSupport.GetTables(); TextTitle.Text = ""; if (TitlesListBox.SelectedValue != null) { string title = TitlesListBox.SelectedValue.ToString(); TextTitle.Text = DataBaseSupport.records[title]; } }
private void DelTableButton_Click(object sender, RoutedEventArgs e) { string str = TablesComboBox.Text.ToString(); DataBaseSupport.DeleteTable(str); TablesComboBox.ItemsSource = DataBaseSupport.GetTables(); if (TablesComboBox.SelectedValue != null) { TitlesListBox.ItemsSource = DataBaseSupport.GetTitles(TablesComboBox.SelectedValue.ToString()); } }
private void Window_Activated(object sender, EventArgs e) { TablesComboBox.ItemsSource = DataBaseSupport.GetTables(); if (TablesComboBox.SelectedValue != null) { string nameTable = TablesComboBox.SelectedValue.ToString(); if (nameTable.Length > 0) { TitlesListBox.ItemsSource = DataBaseSupport.GetTitles(nameTable); } } }