I’m very new to WPF and don’t know how to do this. I have a text box in a tab item on a tab control. How can I programmatically (C#) determine what tab item is the parent of this text box? I would also like to determine what tab control is the parent of the tab item.
Thanks very much.
TabItem.Parent will provide the logical parent element of the
TabItem; which will be the associatedTabControl. You can use the same approach for any control with theTabItem.If the item is deeper in the tree and becomes unknown in its depth you will need to begin to approach it in a recursive manner.