Reputation: 2985
I have a XAML ListBox, a TextBox inside the ItemTemplate. A user edits text inside the TextBox, and then presses a button in the application bar. How do I keep the focus on the TextBox after the button in the application bar was pushed?
Upvotes: 0
Views: 365
Reputation: 65564
You don't. You set it back afterwards.
You can use Focus()
method to do this.
You can also use the SelectionStart
and SelectionLength
to highlight a specific part of the text.
Upvotes: 3