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
400
How to customize TabGroupPane header in DocumentContentHost
posted

Hi,

   I had found one issue with TabGroupPane header . It don't show Underscore present in Header of contentpane when placed inside TabgroupPane .

<igDock:DocumentContentHost>
                            <igDock:SplitPane x:Name="Tabs">
                                <igDock:TabGroupPane>
                                    <igDock:ContentPane AllowClose="True" CloseAction="RemovePane" 
                            Header="My_Photos" x:Name="myphotos">
                                        <!--<igDock:ContentPane.HeaderTemplate>
                                            <DataTemplate>
                                                <TextBlock Text="Deep Is Great"/>
                                            </DataTemplate>
                                        </igDock:ContentPane.HeaderTemplate>-->
                                        <local:UserControl1/>
                                    </igDock:ContentPane>
 </igDock:TabGroupPane>
                            </igDock:SplitPane>
                        </igDock:DocumentContentHost>
 
As you can see Header="My_Photos" but on window I can see header as "MyPhotos" 
I think the problem is Default IG HeaderTemplate might be using Label which is taking "_"
as AccessKey. 
 
Now I created a HeaderTemplate for ContentPane but it's not working
for Tabheader, but if we make the contentPane floating it's showing me "_" .

Can you guys suggest any solution for it???
 
Parents
No Data
Reply
  • 54937
    Verified Answer
    Offline posted

    Deep said:
    I think the problem is Default IG HeaderTemplate might be using Label which is taking "_"
    
    as AccessKey. 
    
    
    
    
    

    It doesn't contain a Label but content type controls usually contain a ContentPresenter and it is the RecognizesAccessKey property of the ContentPresenter that determines if the CP will consider using an AccessKey element if the Content is a string that contains an underscore. And in this case the Template for the PaneTabItem when hosted in the DocumentContentHost does have this set to true. You can either set the TabHeaderTemplate such that it just contains a TextBlock, etc. with the appropriate binding or you can retemplate the PaneTabItem or you can escape the underscore in your text (i.e. precede the underscore with an underscore).

    Deep said:
    Now I created a HeaderTemplate for ContentPane but it's not working
    
    for Tabheader
    
    
    

    The TabHeaderTemplate affects the TabItem.

Children