I apologize if the title is bad, I do not exactly know how to express myself about this issue.
I have a program written in C#, WPF, where I have a number of TabItems. inside these TabItems I have a couple of textboxes, checkboxes etc. Inside these "main" TabItems are also additional TabItems containing textboxes, checkboxes etc. What I want to do is to be able to store all values from these controls in a xml file. I have managed to do so for all the visible ones by standing in one of the main TabItems and executing the following code:
List<TextBox> allTxt = FindVisualChildren<TextBox>(this).ToList<TextBox>(); // this here is my MainWindow (Interaction logic for MainWindow.xaml)
foreach (TextBox t in allTxt)
list.Add(t.Name + ":" + t.Text); // list is a List I store these in
//The same goes later for checkboxes etc.
I then store these in the desired file and this works fine, for the visible ones. But how can I do in order to include all the controls from all the "second" TabItems as well as all the ones from the "main" ones? I have tested to change the Selected TabItem to increse this one after the first one is complete but this does not seem to be working...