1
votes

I have a couple of grids in my application and if the combo box that is in grid A has the focus, then A should be visible. Following code totally works fine for Text boxes, and even the combo box, but it doesn't work when I click on the drop down and try to click on an item in the drop down.

<DataTrigger Binding="{Binding IsFocused, ElementName=FwInstances}" Value="True">
 <Setter Property="Visibility" Value="Visible"/>
</DataTrigger>

I am assuming the items in the combo box takes focus when I try to select it? Any explanation on what exactly happens here would be appreciated.

1

1 Answers

0
votes

Yes, Focus will be set to Popup content once you open and access the Popup content. So instead of Focused, you could bind to IsKeyBoardFocusWithin property of ComboBox, which remains true, even if you are in Popup.

<DataTrigger Binding="{Binding IsKeyboardFocusWithin,ElementName=FwInstances,Mode=OneWay}" Value="True">
 <Setter Property="Visibility" Value="Visible"/>
</DataTrigger>