I've simplified my problem to the code below which can simply be dropped into LinqPad and run.
The problem is when I tab through the WPF controls hosted inside the WinForms MDI child - the focus moves between textboxes until the last at which point focus jumps to the second MDI child (which in my example is all WinForms and tabbing between the textboxes works fine there.)
How can I prevent the WPF tabbing swapping from one MDI child to another and instead keep the focus in the WPF textboxes. (If WinForms controls appear before/after the ElementHost then ideally the focus would travel from WinForms to WPF to WinForms then back to the first WinForms.)
var mdiParent = new Form();
mdiParent.IsMdiContainer = true;
mdiParent.Width = 800;
mdiParent.Height = 600;
mdiParent.Show();
var otherChild = new Form();
otherChild.MdiParent = mdiParent;
var flow = new FlowLayoutPanel();
flow.Controls.Add(new TextBox());
flow.Controls.Add(new TextBox());
flow.Controls.Add(new TextBox());
otherChild.Controls.Add(flow);
otherChild.Show();
var form = new Form();
form.MdiParent = mdiParent;
var elementHost = new ElementHost();
elementHost.Dock = DockStyle.Fill;
form.Controls.Add(elementHost);
string xaml = @"
<StackPanel xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'>
<TextBox />
<TextBox />
<TextBox />
</StackPanel>
";
elementHost.Child = (UIElement)System.Windows.Markup.XamlReader.Load(new XmlTextReader(new StringReader(xaml)));
form.Show();