I'm using the WPF HandyControl TabControl and I want to customize the content displayed in the dropdown when there are too many tabs to fit within the visible area. Currently, when the tab width exceeds the TabControl's visible area, the displayed content isn't what I expect. I've tried using ItemTemplate and DropDownContentTemplate, but it seems I'm not getting the desired results.
<hc:TabControl
IsAnimationEnabled="False"
IsDraggable="False"
IsTabFillEnabled="False"
ItemsSource="{Binding DataSaves, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
SelectedItem="{Binding SelectedDataSave, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}">
<hc:TabControl.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock
Name="txt1"
Margin="6,0,0,0"
VerticalAlignment="Center"
Text="{Binding DisplayName}" />
</StackPanel>
</DataTemplate>
</hc:TabControl.ItemTemplate>
<hc:TabControl.ContentTemplate>
<DataTemplate>
<ContentPresenter Content="{Binding UserControl, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" />
</DataTemplate>
</hc:TabControl.ContentTemplate>
</hc:TabControl>
I suggest to use ComboBox + ContentControl over the TabControl.
and in your WPF,
and you define, the content template by using DataTemplate or DataTemplateSelector