title: Why DataConnectionDialog window are different depending on thread it running?
body: <p>I got an WPF form with <code>DataConnectionDialog</code> (from <code>Microsoft.Data.ConnectionUI</code>)</p>
  
  <p>And the thing is in case of it called from the same thread as UI it looks like this:</p>
  
  <p><a href="https://i.stack.imgur.com/slkuX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/slkuX.png" alt="enter image description here"></a></p>
  
  <p>Code is here:</p>
  
  <pre><code>private void btnSetDbConnection_OnClick(object sender, RoutedEventArgs e)
  {
      string connectionString = null;
  
      try
      {
          //await Task.Run(() =&gt; 
          //{
                DataConnectionDialog dataConnectionDialog = new DataConnectionDialog();                  Microsoft.Data.ConnectionUI.DataSource.AddStandardDataSources(dataConnectionDialog);
                dataConnectionDialog.SelectedDataSource = Microsoft.Data.ConnectionUI.DataSource.SqlDataSource;
                dataConnectionDialog.SelectedDataProvider = Microsoft.Data.ConnectionUI.DataProvider.SqlDataProvider;
  
                if (DataConnectionDialog.Show(dataConnectionDialog) == System.Windows.Forms.DialogResult.OK)
                {
                  _dataHandler.InitializeConnection(dataConnectionDialog.ConnectionString);
                }
            //}).ConfigureAwait(false);                
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
  </code></pre>
  
  <p>And if not - like that:</p>
  
  <p><a href="https://i.stack.imgur.com/JbewM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JbewM.png" alt="enter image description here"></a></p>
  
  <p>Code (well, it's the same but uncommented):</p>
  
  <pre><code>private async void btnSetDbConnection_OnClick(object sender, RoutedEventArgs e)
  {
      string connectionString = null;
  
      try
      {
          await Task.Run(() =&gt;
          {
              DataConnectionDialog dataConnectionDialog = new DataConnectionDialog();
              Microsoft.Data.ConnectionUI.DataSource.AddStandardDataSources(dataConnectionDialog);
              dataConnectionDialog.SelectedDataSource = Microsoft.Data.ConnectionUI.DataSource.SqlDataSource;
              dataConnectionDialog.SelectedDataProvider = Microsoft.Data.ConnectionUI.DataProvider.SqlDataProvider;
  
              if (DataConnectionDialog.Show(dataConnectionDialog) == System.Windows.Forms.DialogResult.OK)
              {
                  _dataHandler.InitializeConnection(dataConnectionDialog.ConnectionString);
              }
          }).ConfigureAwait(false);
      }
      catch (Exception ex)
      {
          throw ex;
      }
  }
  </code></pre>
  
  <p>Wondering why is so?</p>