I'm trying to write a text editor in WPF and I have a problem trying to locate the correct instance of an editor within a TabControl
in response to a File -> Open action.
Tab items are added programatically and contain a WindowsFormsHost
instance which in turn allows each tab to display an editor provided by the ScintillaNet WinForms component.
When a tab is selected and a user selects File -> Open, I need to locate the correct WindowsFormsHost instance based on the tab selection so I can load the file into the correct Scintilla instance.
Previously, I'd done this in WinForms simply by doing:
tabControl.TabPages[tabControl.SelectedIndex].Controls.Find("Scintilla")
How does this work in WPF?