WPF attached property set in tabcontrol being used in GridColumn header
<p>Hi My main objective is to rename gridcontrol(datagrid) column headers based on the tabitem header text. Meaning if the tabitem headertext is named "TabItem 1" I would like to take that "TabItem 1" and append some string to it and set it to a datagrid column header. The tabcontrol / tabitems header and the grid are being populated at run time by the Observable collection containing an object Headertext that will go to the tabitem header and a List which will populate the datagrid. 
I was advised to create an attached property and Valueconverter. The attached property is the first thing I am trying to achieve and after researching I got the idea that if I create an attached property I can set a value to it and be able to use it anywhere in the xaml in my case the header in a datagrid column. My issue is I set up a attached property as so: </p>

<pre><code> public class Ex : DependencyObject
{
    public static readonly DependencyProperty
        TabHeaderTextProperty =
        DependencyProperty.RegisterAttached(
              "TabHeaderText", typeof(string), typeof(Ex),
        new PropertyMetadata(""));
    public static string GetTabHeaderText(
        DependencyObject d)
    {
        return (string)d.GetValue(TabHeaderTextProperty);
    }
    public static void SetTabHeaderText(
        DependencyObject d, string value)
    {
        d.SetValue(TabHeaderTextProperty, value);
    }
}
</code></pre>

<p>and I am trying to use it in the TabControl and set the HeaderText to the attached property as so</p>

<pre><code>&lt;TabControl  Grid.Row="1" ItemsSource="{Binding Workspaces}" Height="Auto"      Background="Transparent" x:Name="Tabs" &gt;
&lt;TabControl.ItemTemplate&gt;
&lt;DataTemplate &gt;
&lt;TextBlock Text="{Binding HeaderText}" localHelper:Ex.TabHeaderText="{Binding  HeaderText}" /&gt;
   &lt;/DataTemplate&gt;
                        &lt;/TabControl.ItemTemplate&gt;
                        &lt;TabControl.ContentTemplate&gt;
&lt;DataTemplate x:Name="Tabsitems"&gt;
                                &lt;Grid&gt;
                                    &lt;Grid.RowDefinitions&gt;
                                        &lt;RowDefinition Height="50"/&gt;
                                        &lt;RowDefinition Height="725" /&gt;
                                    &lt;/Grid.RowDefinitions&gt;
                                    &lt;Grid.ColumnDefinitions&gt;
                                        &lt;ColumnDefinition Width="1600" /&gt;
                                    &lt;/Grid.ColumnDefinitions&gt;
                                    &lt;TextBlock Text ="{Binding localHelper:Ex.TabHeaderText}" Grid.Row="0" Grid.Column="0"/&gt;
                                                      &lt;dxg:GridControl Grid.Row="1" x:Name="Grid" ItemsSource="{Binding Data}" &gt;
                                        &lt;dxgcore:GridControl.Columns&gt;
    &lt;dxg:GridColumn Name="Month1" FieldName="Month01" Visible="True" AllowEditing="False" HorizontalHeaderContentAlignment="Center" CellStyle="{StaticResource NumberCellStyle}"&gt;
                                                &lt;dxg:GridColumn.Header&gt;


                                                    &lt;TextBlock Text ="{Binding localHelper:Ex.TabHeaderText}" /&gt;

                                                &lt;/dxg:GridColumn.Header&gt;
                                                &lt;dxg:GridColumn.EditSettings&gt;
                                                    &lt;dxe:TextEditSettings HorizontalContentAlignment="Right" /&gt;
                                                &lt;/dxg:GridColumn.EditSettings&gt;
                                            &lt;/dxg:GridColumn&gt;
 &lt;/dxgcore:GridControl.Columns&gt;
                                    &lt;dxgcore:GridControl.View&gt;
                                        &lt;dxgcore:TableView x:Name="View" 
                                       AllowEditing="False" 
                                       AllowBestFit="True" 
                                       AllowMoving="True" 
                                       AllowColumnFiltering="True"
                                       IsColumnMenuEnabled="True"
                                       ShowGroupPanel="False"
                                       ShowAutoFilterRow="True"
                                       AutoWidth="False" 
                                       NavigationStyle="Cell"
                                       VerticalScrollbarVisibility="Visible"
                                       HorizontalScrollbarVisibility="Visible"

                                        &lt;/dxgcore:TableView&gt;
                                    &lt;/dxgcore:GridControl.View&gt;
                                &lt;/dxg:GridControl&gt;

                            &lt;/Grid&gt;
                        &lt;/DataTemplate&gt;
                    &lt;/TabControl.ContentTemplate&gt;
                &lt;/TabControl&gt;
</code></pre>

<p>The issue that I am getting now is that even thou I am setting the attached property (I think) to avalue HeaderText I also hardcoded (just as a test), I am not able to see it when I use it in a datagridcolumn header or just a textblock outside of the datagrid.What am I doing wrong?</p>