I had made a user control that is a replacement for the combo box, it has search and LINQ queries capabilities.
The control is made by composition, it has a TextBox where the user type, a TextBlock that serves as the auto-complete label, a ListBox inside a Popup for the drop down and the drop down button.
The problem is that each of this controls has its own focus, and when a consumer of this user control calls the SetFocus() for the user control, the focus is not setted to the TextBox, even if I subscribe to the GotFocus event, this is because the user control itself is not focusable.
If instead I set the IsFocusable = True and KeyboardNavigation.IsTabStop = True the user control itself can be focused, but the text box its not focused, instead, a dotted line appears around the control
I need that the user control behave the same way as the native ComboBox, when a consumer calls the SetFocus() the inner TextBox should be focusd
I could expose a custom method for focusing the inner TextBox, but this is not an option because I have an attached property (from this question) that allows me to set the focus of any control from the ViewModel, thus the focus behaviour should be the same for all controls