If you're having trouble setting focus to a textbox in a child control (within a
ContentControl for example)...
then hook up a delegate to .Loaded in the constructor, i.e.:
public partial class LoginView : UserControl
{
public LoginView()
{
InitializeComponent();
this.Loaded += delegate { this.UserNameTextBox.Focus(); };
}
}
The issue seems to be that the act of databinding overrides any focus set earlier. For example, this won't work:
public partial class LoginView : UserControl
{
public LoginView()
{
InitializeComponent();
this.UserNameTextBox.Focus();
}
}