Tabitem header is not showing its label using Prism and WPF

683 Views Asked by At

I am working on WPF and prism5 and also using RadTabControl,I am able to create tabs dynamically, now issue is i am not able to set tab header, i am using eventAggregator, value is coming fine till shellViewModel but its not able to set Tab header

My tab control is in shellview.xaml its code is

  <telerik:RadTabControl prism:RegionManager.RegionName="ContentRegion"
                                Margin="1" x:Name="tabControl"
                                VerticalContentAlignment="Stretch"
                                HorizontalContentAlignment="Stretch"                                            
                              ItemTemplate="{StaticResource TabItemTemplate}"/>    

and here is my code for tab item

 <DataTemplate x:Key="TabItemTemplate">
             <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
                 <TextBlock Text="{Binding TabHeader}"/>
                 <telerik:RadButton Command="{Binding RemoveItemCommand}"
                         Style="{StaticResource CloseButton}"
                         Margin="10,0,0,0"
                         ToolTipService.ToolTip="Remove item" />
             </StackPanel>
         </DataTemplate>

tab is creating fine with its view but its not able to set tab header value, Please let me know what is the issue.

Thanks

1

There are 1 best solutions below

0
On

Issue was i was not setting TabHeader property in its own ViewModel which was causing not to display header name.

Thanks