prism - Unable to set binding for HeaderTemplate of TabItem
I have a UserControl named ProductEditView which I am adding to a region of my MainWindow (shell). I have a TabControl in Shell region to display the ProductEditView like below


    <TabControl Name="tabEditProduct" 
                prism:RegionManager.RegionName="TabContent"

        <TabControl.ItemContainerStyle>
        <Style TargetType="TabItem">
            <Setter Property="HeaderTemplate">
                <Setter.Value>
                    <DataTemplate>
                        <DockPanel LastChildFill="True" >
                            <Button Width="16" Height="16" Command="{Binding Path=CloseTabCommand}" 
                                            DockPanel.Dock="Right" BorderThickness="0" Padding="0"
                                            BorderBrush="Transparent" Background="Transparent">
                                <Image Source="Images/close-icon.png" Width="14" Height="14" 
                                               HorizontalAlignment="Stretch" Margin="0"/>
                            </Button>
                            <TextBlock Text="{Binding ProductName}" 
                                               DockPanel.Dock="Left" Margin="0,0,10,0" />
                        </DockPanel>
                    </DataTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        </TabControl.ItemContainerStyle>
    </TabControl>

In the TabItem's HeaderTemplate I am trying to display text from the Product Object using binding. Unfortunately the binding is not working, but I can display static text as header. **Is it possible to display the Header Text of Tab Item using binding like above?** 

For completeness, I am also pasting the view to Edit Product that loads in the TabControl region as TabItem. The bindings for that are working well. Here is the ProductEditView


    <UserControl x:Class="TextExisting.CoreModule.ProductEditView"
    ....
    
            <Grid HorizontalAlignment="Center" DataContext="{Binding Path=Product}" Grid.Row="0" Grid.Column="0">
            ....
                <TextBlock Text="Id" Grid.Row="0" Grid.Column="0"/>
                <TextBox Grid.Row="0" Grid.Column="1" 
                         Text="{Binding Path=Id, NotifyOnValidationError=True, ValidatesOnExceptions=True}" />
                
                <TextBlock Text="Product Name" Grid.Row="1" Grid.Column="0"/>
                <TextBox Grid.Row="1" Grid.Column="1" 
                         Text="{Binding Path=ProductName, NotifyOnValidationError=True, ValidatesOnExceptions=True}" />
                ....
            </Grid>
            <Button Command="{Binding SaveProductCommand}" Content="Save Product" HorizontalAlignment="Center"/>
    
    </UserControl>

regards,
Nirvan.
prism - Unable to set binding for HeaderTemplate of TabItem
===

I have a UserControl named ProductEditView which I am adding to a region of my MainWindow (shell). I have a TabControl in Shell region to display the ProductEditView like below


    <TabControl Name="tabEditProduct" 
                prism:RegionManager.RegionName="TabContent"

        <TabControl.ItemContainerStyle>
        <Style TargetType="TabItem">
            <Setter Property="HeaderTemplate">
                <Setter.Value>
                    <DataTemplate>
                        <DockPanel LastChildFill="True" >
                            <Button Width="16" Height="16" Command="{Binding Path=CloseTabCommand}" 
                                            DockPanel.Dock="Right" BorderThickness="0" Padding="0"
                                            BorderBrush="Transparent" Background="Transparent">
                                <Image Source="Images/close-icon.png" Width="14" Height="14" 
                                               HorizontalAlignment="Stretch" Margin="0"/>
                            </Button>
                            <TextBlock Text="{Binding ProductName}" 
                                               DockPanel.Dock="Left" Margin="0,0,10,0" />
                        </DockPanel>
                    </DataTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        </TabControl.ItemContainerStyle>
    </TabControl>

In the TabItem's HeaderTemplate I am trying to display text from the Product Object using binding. Unfortunately the binding is not working, but I can display static text as header. **Is it possible to display the Header Text of Tab Item using binding like above?** 

For completeness, I am also pasting the view to Edit Product that loads in the TabControl region as TabItem. The bindings for that are working well. Here is the ProductEditView


    <UserControl x:Class="TextExisting.CoreModule.ProductEditView"
    ....
    
            <Grid HorizontalAlignment="Center" DataContext="{Binding Path=Product}" Grid.Row="0" Grid.Column="0">
            ....
                <TextBlock Text="Id" Grid.Row="0" Grid.Column="0"/>
                <TextBox Grid.Row="0" Grid.Column="1" 
                         Text="{Binding Path=Id, NotifyOnValidationError=True, ValidatesOnExceptions=True}" />
                
                <TextBlock Text="Product Name" Grid.Row="1" Grid.Column="0"/>
                <TextBox Grid.Row="1" Grid.Column="1" 
                         Text="{Binding Path=ProductName, NotifyOnValidationError=True, ValidatesOnExceptions=True}" />
                ....
            </Grid>
            <Button Command="{Binding SaveProductCommand}" Content="Save Product" HorizontalAlignment="Center"/>
    
    </UserControl>

regards,
Nirvan.