AdvancedTabControl Template?

Docking/MDI for WPF Forum

Posted 29 days ago by Ethem Acar
Version: 22.1.3
Avatar

So I implemented TreeListBox with ItemTemplateSelector which was awesome I could style & build the content exactly like i wanted. Now I'm on the DockControls AdvancedTabControl and can't find anything how I can customize the tab content based on the class with a ItemTemplateSelector. I feel like its not possible? Only Icon & Title is customizable? My goal is to have Label - Icon - Label.

[Modified 28 days ago]

Comments (4)

Posted 29 days ago by Ethem Acar
Avatar

So I tried this with no luck :D

 <dockingViewModels:TabControlTemplateSelector x:Key="TabControlTemplateSelector">
        <dockingViewModels:TabControlTemplateSelector.GlobalTemplate>
            <DataTemplate>
                <Grid ShowGridLines="False">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>
                    <Label
                        Grid.Column="0"
                        Margin="0,0,5,0"
                        Padding="0,0,0,0"
                        Content="Test"
                        FontSize="10"/>
                </Grid>
            </DataTemplate>
 </dockingViewModels:TabControlTemplateSelector.GlobalTemplate>

<Style x:Key="TabControlStyle" TargetType="docking:AdvancedTabControl">
  <Setter Property="ItemTemplateSelector" Value="{StaticResource TabControlTemplateSelector}" />
</Setter>
Answer - Posted 28 days ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

The AdvancedTabItem control inherits the native WPF TabItem control, but its Template is much more complex than TabItem's.  It has additional elements like buttons and context display elements.  There is a ContentPresenter in the Template that is bound to Header/HeaderTemplate, however it appears it was missing a binding to HeaderTemplateSelector too.  We will add that for the upcoming maintenance release.

If you set a single DataTemplate to the tab control's ItemTemplate property instead, does that work?


Actipro Software Support

Posted 28 days ago by Ethem Acar
Avatar

If you set a single DataTemplate to the tab control's ItemTemplate property instead, does that work?

Yes it does work.

Sadly different class types need different contents for my tabs so I will wait for selectors fix release.

Posted 28 days ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Ok good, then the update we made for the next maintenance release should work for you since ItemTemplate is currently wired up in a way ItemTemplateSelector previously was not.


Actipro Software Support

The latest build of this product (v22.1.4) was released 25 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.