Hi
In order to display a help screen I have to figure out what element is focused. Normally I just go up the visual tree until I come across a well-known element for which a help is defined. I thought for Ribbon this could be a RibbonTabItem. I therefore added a help-refererence for each RibbonTabItem. I assumed that as soon as I click anywhere into the Ribbon-Tab, I just have to go up the visual tree until I come across a RibbonTabItem. However, this seems not to be the case (except I'm on the tab-header). I instead bump into a XamTabControl... Can anybody explain the visual tree of the Ribbon?
Thank you!
I'm not sure I follow. You have no content in any tab so what you are clicking on is part of the tab control so you wouldn't find the tab item up the ancestor chain. If you had some elements that were content of the tabitem and they were hit testable then you would have hit the tab item. E.g. put a Grid as the content of the TabItem and set its Background to Transparent.
Any hints? Please let me know if I have to provide additional information...
Please check out my Testapp I attached. I never come across a RibbonTabItem once I click in the content of a tab... (it works if I click in the header)
RibbonTabItem derives from TabItem. Are you sure that the TabItem that you found was not a RibbonTabItem with the Name set? If so then I would need to see a sample that shows the issue so I could see what is going on.
Sorry for confusing you...
I set an x:Name on each RibbonTabItem (only). If I click anywhere in the tab I was hoping to come across a RibbonTabItem using your solution while walking the tree. However, I came across a TabItem (as in your code) and not a RibbonTabItem (except if I click on the header). It seems to be not enough to set x:Name on RibbonTabItem only...