Assume there is a WPF window with multiple textboxes and one button. Currently the cursor is blinking in one of the textBox and then on button click I launched a modal window and then on close of this Window I want the Cursor blinking back to the textbox where it was before launch of the modal window. How I can achieve it in WPF?
FocusManager.GetFocusedElement
It will give the button, not the textbox.