`DropDownButton` currently relies on `Popup.StaysOpen` to close the content when the user clicks away. However, this fails in this scenario:
```
<StackPanel>
<ToggleButton x:Name="toggleButton">
Click to open first popup
</ToggleButton>
<Popup IsOpen="{Binding IsChecked, ElementName=toggleButton}" PlacementTarget="{Binding ElementName=toggleButton}" Placement="Bottom" StaysOpen="False">
<Border Background="White" BorderBrush="Black" BorderThickness="1" Padding="3">
<StackPanel>
<TextBlock>Here is somewhere for you to click once the below ComboBox or DropDownButton is open</TextBlock>
<ComboBox>
<ComboBoxItem>First</ComboBoxItem>
<ComboBoxItem>Second</ComboBoxItem>
</ComboBox>
<xctk:DropDownButton>
Here is the drop-down button
<xctk:DropDownButton.DropDownContent>
<Label>Here is the content</Label>
</xctk:DropDownButton.DropDownContent>
</xctk:DropDownButton>
</StackPanel>
</Border>
</Popup>
</StackPanel>
```
So simply placing a `DropDownButton` within a `Popup` is problematic because the user can't click away inside the hosting `Popup` in order to dismiss the `DropDownButton`. But you'll notice that the `ComboBox` does not suffer from the same problem. That's because, internally, it uses an `IsDropDownOpen` property instead of relying on `Popup.StaysOpen`. It handles various mouse and keyboard events to ensure that `IsDropDownOpen` is set to `false` at appropriate times.
`DropDownButton` needs to exhibit this same behavior if it is to be useful within a `Popup`.
Comments: ** Comment from web user: emartin **
```
<StackPanel>
<ToggleButton x:Name="toggleButton">
Click to open first popup
</ToggleButton>
<Popup IsOpen="{Binding IsChecked, ElementName=toggleButton}" PlacementTarget="{Binding ElementName=toggleButton}" Placement="Bottom" StaysOpen="False">
<Border Background="White" BorderBrush="Black" BorderThickness="1" Padding="3">
<StackPanel>
<TextBlock>Here is somewhere for you to click once the below ComboBox or DropDownButton is open</TextBlock>
<ComboBox>
<ComboBoxItem>First</ComboBoxItem>
<ComboBoxItem>Second</ComboBoxItem>
</ComboBox>
<xctk:DropDownButton>
Here is the drop-down button
<xctk:DropDownButton.DropDownContent>
<Label>Here is the content</Label>
</xctk:DropDownButton.DropDownContent>
</xctk:DropDownButton>
</StackPanel>
</Border>
</Popup>
</StackPanel>
```
So simply placing a `DropDownButton` within a `Popup` is problematic because the user can't click away inside the hosting `Popup` in order to dismiss the `DropDownButton`. But you'll notice that the `ComboBox` does not suffer from the same problem. That's because, internally, it uses an `IsDropDownOpen` property instead of relying on `Popup.StaysOpen`. It handles various mouse and keyboard events to ensure that `IsDropDownOpen` is set to `false` at appropriate times.
`DropDownButton` needs to exhibit this same behavior if it is to be useful within a `Popup`.
Comments: ** Comment from web user: emartin **
Thanks for your well described issue and proposed fix.
I will look forward to include a fix for it, but I must tell you that we are in the last steps of the v2.0 dev.
What we are actually doing, right now, is fixing issues requested by "plus" and wpf/ultimate suite subscribers. If you think that fixing this issue is of value for your company, consider subscribing to a license of the Plus edition and submit your case to the support team asap. It will for sure be on the top of my task list and be there for version 2.0. If you intent to do so, be sure to inform the salesman that you are subscribing to get v2.0.