private void _informationSchemaTreeView_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs <object> e) { TableTV tableTV = ((TreeView)sender).SelectedItem as TableTV; if (tableTV == null) { ViewModel.TableContent = null; } else { ViewModel.UpdateDataGrid(tableTV.Name); } }
private void UpdateInfoSchemaTV() { DataTableReader reader = _iDatabase.InformationSchema.TABLES.CreateDataReader(); // Regenerate the data for the tree view InformationSchemaTV updatedTV = new InformationSchemaTV() { Name = String.Format("{0} ({1})", Path.GetFileName(_databasePath), this.ServerVersionFromFile), }; while (reader.Read()) { TableTV tableTV = new TableTV() { Name = reader.GetString(reader.GetOrdinal("TABLE_NAME")) }; updatedTV.TablesCollection.Add(tableTV); } _infoSchemaTVCollection = new List <InformationSchemaTV>(); _infoSchemaTVCollection.Add(updatedTV); NotifyPropertyChanged("InfoSchemaTVCollection"); }