private void PopulateDatasources()
        {
            Thread thread = new Thread(
                new ThreadStart(
                    delegate() {
                try {
                    if (SelectedDatabaseDriver != null)
                    {
                        SetIsLoading(true);
                        SelectedDatabaseDriver.PopulateDatasources();
                    }
                } catch (Exception ex) {
                    Dispatcher.BeginInvoke(DispatcherPriority.Background,
                                           new Action(() => {
                        MessageBox.Show(this, ex.Message, this.Title, MessageBoxButton.OK, MessageBoxImage.Error);
                    }));
                } finally {
                    SetIsLoading(false);
                }
            }
                    )
                );

            thread.SetApartmentState(ApartmentState.STA);
            thread.IsBackground = true;
            thread.Start();
        }
        private void PopulateDatasources()
        {
            Thread thread = new Thread(new ThreadStart(delegate()
            {
                if (SelectedDatabaseDriver != null)
                {
                    SetIsLoading(true);
                    SelectedDatabaseDriver.PopulateDatasources();
                    SetIsLoading(false);
                }
            }
                                                       ));

            thread.SetApartmentState(ApartmentState.STA);
            thread.IsBackground = true;
            thread.Start();
        }