views:

388

answers:

2

I've been looking at the following example on how to style the combo box, but I haven't been able to create a focus effect when going into a editable combo box. Whenever the combo box receives focus, it should go into edit mode and the component should have a focus style.

The basic problem is that whenever I go into the edit mode, it's not the surrounding combo box which actually has the focus, but the text subcomponent and I haven't been able to create a trigger on the text component which modifies the combo box's border style since I don't know how to refer to the parent component from the trigger.

I've tried adding controltemplate trigger on the textbox, or style trigger. I've tried to refer to the combo box by name or by using the TemplateBinding option, but without any luck. A simple example would be very appreciated.

A: 

Did u find any solution to this problem?. Thanks, Rey.

Rey
No - sorry. I ended up working around the problem with some code of a custom component I found on the net.
tronda
+1  A: 

Bind IsKeyboardFocusWithin to IsDropDownOpen

<ComboBox ItemsSource="{Binding SortedItems}" StaysOpenOnEdit="True"
              IsDropDownOpen="{Binding IsKeyboardFocusWithin, 
                  RelativeSource={RelativeSource Self}, 
                  Mode=OneWay}">
</ComboBox>
masenkablast