I have Binding a ObservableCollection to ItemSource. And I set the Item Header Property Style to binding a string.
I want it can display the Header Like Page 1
, Page 2
etc.. according to the binding object index.
How Can I do something in the TabControl_Header' get function in VM Class?
View
<Style x:Key="_HeaderString" TargetType="TabItem">
<Setter Property="Header" Value="{Binding DataContext.TabControl_Header , Mode=OneWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}"/>
</Style>
ViewModel
public string TabControl_Header
{
get { return "Page_"+???; }
}