Here is an overview of my application:
It is basically a cook book. The user can create a cookbook and then create recipes within that cookbook. I have a class CookBook and a class Recipe. CookBook keeps track of what recipes are associated with the cook book and Recipe keeps track of the contents of the recipe.
For the UI, i have a treeview where it will display the recipes that are in the CookBook. I have a TabControl that will display the tabs associated with each recipe. The tabs are dynamically created by the user during run time.
When the user clicks on one of the recipes, i want the TabControl to show the tabs related to that specific recipe. When the user clicks on a different recipe i want the tabs for the previous selection to go away and the tabs of the current selection to appear. (side note: I will be saving the contents of the tab and stuff to a file later, for saving purposes)
I want the Recipe class to contain the details about the TabControl (how many tabs there are for the recipe, title of each of the tabs, contents of the tabs). But i do not want Recipe to be responsible for creating the Tabs or TabControl.
My questions is, how do i accomplish the bolded section above? What are people’s opinions and experience with this type of problem? What are the best practices for this type of problem?
THANKS!
I hope that the following code gives you an idea