I'm trying to set focus on TextBox but Focus() method returns false
this.NameTextBox.Focus(FocusState.Programmatic);
However in msdn it is written:
Focus(FocusState value)
Return value: True if focus was set to the control, or focus was already on the control. False if the control is not focusable.
and
You typically pass FocusState.Programmatic as the parameter to indicate the control obtained focus through a deliberate call to the Focus method. For example, if clicking an "Edit" button causes focus to be set on a TextBox, use the Programmatic focus state.
So why does my command not work?