title: Win8 ComboBox IsDropDownOpen + Visibility causes Glitched UI
body: <p>I am developing a Windows 8 App using XAML and C#.
  I have a problem with my ComboBox, and have a simple example to demonstrate it.</p>
  
  <ol>
  <li><p>Add the following to a Layout Aware Page (New BasicPage)</p>
  
  <pre><code>&lt;ComboBox x:Name="comboBox1" DropDownClosed="comboBox1_DropDownClosed" Visibility="Collapsed" HorizontalAlignment="Left" Margin="179,217,0,0" Grid.Row="1" VerticalAlignment="Top" Width="998" Height="51"&gt;
      &lt;x:String&gt;Option 1&lt;/x:String&gt;
      &lt;x:String&gt;Option 2&lt;/x:String&gt;
      &lt;x:String&gt;Option 3&lt;/x:String&gt;
  &lt;/ComboBox&gt;
  &lt;Button Click="Button_Click" Margin="585,130,0,416" Grid.Row="1" Height="82" Width="154"&gt;
      &lt;Viewbox&gt;
          &lt;TextBlock Text="Press Me" /&gt;
      &lt;/Viewbox&gt;
  &lt;/Button&gt;
  </code></pre></li>
  <li><p>Add this to the page's CodeBehind</p>
  
  <pre><code>private void Button_Click(object sender, RoutedEventArgs e)
  {
      comboBox1.Visibility = Windows.UI.Xaml.Visibility.Visible;
      comboBox1.IsDropDownOpen = true;
  }
  
  private void comboBox1_DropDownClosed(object sender, object e)
  {
      comboBox1.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
  }
  </code></pre></li>
  </ol>
  
  <p><strong>Expected:</strong>
  When the button is pressed, the ComboBox should appear and the options should expand, allowing the user to select one. Once the user has selected an option, the ComboBox disappears.</p>
  
  <p><strong>Actual Result:</strong>
  When the button is pressed, nothing happens. If the button is pressed a second time, the ComboBox appears in a glitched state, and the app is essentially non-responsive. (All input is directed at the ComboBox, which never closes.</p>
  
  <p>Note: The DropDownClosed event fires immediately after the Button_Click event does. Removing the event handler doesn't change anything, but it's interesting that the DropDownClosed event is firing.</p>
  
  <p><strong>Rejected Solution:</strong>
  It was suggested to me to use <code>Dispatcher.RunAsync</code> to set <code>IsDropDownOpen</code> after the <code>Visibility</code> change has taken effect. This seems to be a race condition, because it only works <em>some</em> of the time. <strong>If there were a way to confirm that the ComboBox had been rendered visible,</strong> adding this check to the RunAsync method could solve the problem.</p>
  
  <p>As a workaround, I'm currently delaying Dispatcher.RunAsync for 200 milliseconds, which is an annoying workaround. Any other ideas?</p>