Browse Source

Fix null reference exception in database connection dialog.

The Add button was being enabled when the selected database
changed but on connecting to the server again the selected
database was cleared but the Add button was not disabled.
pull/37/head
Matt Ward 13 years ago
parent
commit
cdfd000f36
  1. 2
      src/AddIns/DisplayBindings/Data/ICSharpCode.Data.Core.UI/Windows/ConnectionWizardWindow.xaml
  2. 6
      src/AddIns/DisplayBindings/Data/ICSharpCode.Data.Core.UI/Windows/ConnectionWizardWindow.xaml.cs

2
src/AddIns/DisplayBindings/Data/ICSharpCode.Data.Core.UI/Windows/ConnectionWizardWindow.xaml

@ -84,7 +84,7 @@ @@ -84,7 +84,7 @@
<TextBlock Grid.Row="5" Margin="3">Database:</TextBlock>
<ComboBox x:Name="cboDatabases" Grid.Row="5" Grid.Column="1" Margin="3" SelectedItem="{Binding SelectedDatabase, ElementName=This}"
ItemsSource="{Binding SelectedDatasource.Databases, ElementName=This}" SelectionChanged="cboDatabases_SelectionChanged">
ItemsSource="{Binding SelectedDatasource.Databases, ElementName=This}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}" />

6
src/AddIns/DisplayBindings/Data/ICSharpCode.Data.Core.UI/Windows/ConnectionWizardWindow.xaml.cs

@ -92,6 +92,7 @@ namespace ICSharpCode.Data.Core.UI.Windows @@ -92,6 +92,7 @@ namespace ICSharpCode.Data.Core.UI.Windows
set
{
_selectedDatabase = value;
btnAdd.IsEnabled = (_selectedDatabase != null);
OnPropertyChanged("SelectedDatabase");
}
}
@ -212,11 +213,6 @@ namespace ICSharpCode.Data.Core.UI.Windows @@ -212,11 +213,6 @@ namespace ICSharpCode.Data.Core.UI.Windows
}
}
private void cboDatabases_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
btnAdd.IsEnabled = true;
}
private void btnAdd_Click(object sender, RoutedEventArgs e)
{
if (_addAction == null)

Loading…
Cancel
Save