0
I own a Tabcontrol with several Tabitems, that I have separated the contents into Usercontrols to organize the code. But they all have a Textbox in common of which I want to get the value on a Button on Mainwindow.
I am new in WPF, I’m still learning, I thought I’d expose the value of Textbox on a public property in each Usercontrol, then get the Tabitem selected ((TabItem)TabControlMain.SelectedItem
), and get the object Usercontrol internal to access such property (could use an interface with a Get method). The problem is that I can’t get this Usercontrol, I don’t know how to do.
I would like to know how to do something like that, or, if that is an inappropriate solution to WPF, I wonder how I could structure my code for such a case: several Tabitems and get internal values from the window that has the Tabcontrol, preferably separated by files (as with Usercontrols).