I have a WPF TreeView with XAML shown below:
in constructor of new form set
this.Focus();
Also, does your new form should be Modal window? if yes use Editor.ShowDialog()
instead of Editor.Show();
It will automatically solve issue with focus
You probably need to let WPF finish the job of handling the current mouse click event(s) before you open the new Window. Let the new window be the next UI job by adding it to the current Dispatcher's queue like this:
(...)
//Editor.Show();
Action showAction = () => Editor.Show();
this.Dispatcher.BeginInvoke(showAction);