Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
746
How do I Access PaneTabItem of a contentpane?
posted

I need to access the PaneTabItem so that I can determine its bounding rectangle in order to determine whether the user is dropping a drag item to the tab header (the content pane is not visible at that time, just the tab header).  Try as I may, I cannot seem to get at it..  Is there a way to get at the panetabitem?  Thanks in advance.

 

Parents
  • 54937
    Offline posted

    There is no property that will return the PaneTabItem. You could use the LogicalTreeHelper to get the parent and if that parent is a TabGroupPane then get the tab item from that. e.g.

        public static PaneTabItem GetPaneTab(ContentPane pane)
        {
            var group = LogicalTreeHelper.GetParent(pane) as TabControl;
     
    if (group != null)
    return group.ItemContainerGenerator.ContainerFromItem(pane) as PaneTabItem;
     
            return null;
        } 
     
     
Reply Children
No Data