I have A 3 Level TreeView which is using multibinding to generate for every instance of Class A 2 TreeViewItems as List of Class B . And every List contains Items lets say of Class C .
I can add Items of Class C for each List in my UI while the Lists(Class B) are collapsed . I can even add Class C for each List(Class B) while the whole TreeViewItem(Class A) is collapsed .
My Problem is I need to be able to access all TreeViewItems even if they are collapsed.(for ex to select them).
I tried doing so but i encountered following problems :
1- All not visible TreeViewItems(of classes B and C) are not yet created as TreeViewItems.(how can i make them be?)
2- When u expand a Class B TreeViewIiem for the FIRST TIME u get to see all its Items(Class C) as TreeViewItems.(obviously trivial)
3- Collapsing after Expanding any Class B (there are only 2) in a specific Class A TreeViewItem will result in being able to add Class C instances as TreeViewItems even if the whole TreeViewItem(Class A) is collapsed .(As long as u stay in this Class A TreeViewItem)
4- If u change the selected Class A(i.e if u click on another TreeViewItem which has an ancestor of Class A different than the choosen one) all not visible TreeViewItems of previously choosen Class A are lost. and u can begin again by step 1 in the newly choose Class A.
So how can i be able to Select any TreeViewItem of Class C or B at any give moment?
Thank you