c# - How to iterate tabs and list boxes within them -
I have a WPF application that is used to select tests which will later be used for an automated testing application Running as part.
In the UI, I have many tab controls that represent each of the exam categories. Each test has a check box for each test box.
When the user selects all of their tests and clicks on the run button, then I must restart the tab to finalize the listboxes and then the test list do not make me many statements That are with these lines:
GetTab1Tests (); GetTab2Tests (); GetTab3Tests (); // Continue I would like to design it in such a way that I can say:
foreach (tab tab in TabControl) {CollectTestsFromListbox (* * List associated with T ** box); } How can I tie this information? My best estimate is to create a dictionary that pairs tabs with the necessary tabs, but is this good practice moving forward? As the test is being done, the more tabs can be increased.
Edit I have tried to set the data contact of the tab at this time: and and I can call in the .xaml.cs file:
tabLoginTests.DataContext This does all {System.Windows.Controls.ListBox Items.Count: 4} . I can not understand this object how it takes the object and Control yourself on the listbox. Any suggestions?
While creating the Chiebocq, try adding the list box to the tag property of the intentional tab control object.
Then you will be able to access it with TAAG then you can put it in the listbox Is an object).
Comments
Post a Comment