title: WPF datagrid button in column header with header text - c#
body: <p>I have a WPF datagrid and i want to apply a button on specific column headers. I managed to insert the button but the HeaderText disapears. What do i have to bind to my TextBlock that the headertext is "Match Ausdruck" in this example?</p>
  
  <p>And how do i access this button?</p>
  
  <p>My App.xaml:</p>
  
  <pre><code>&lt;Style x:Key="columnHeaderButton" TargetType="DataGridColumnHeader"&gt;
      &lt;Setter Property="Template"&gt;
          &lt;Setter.Value&gt;
              &lt;ControlTemplate&gt;
                  &lt;StackPanel Orientation="Horizontal" Width="auto"&gt;
                      &lt;TextBlock Text="Test" VerticalAlignment="Center" /&gt;
                      &lt;Button Style="{StaticResource MyButton}" 
                          Width="16" 
                          Height="16" 
                          VerticalAlignment="Center"&gt;
                          &lt;Button.Background&gt;
                              &lt;ImageBrush ImageSource="Resources/filter.png"/&gt;
                          &lt;/Button.Background&gt;
                      &lt;/Button&gt;
                  &lt;/StackPanel&gt;
              &lt;/ControlTemplate&gt;
          &lt;/Setter.Value&gt;
      &lt;/Setter&gt;
  &lt;/Style&gt;
  </code></pre>
  
  <p>My MainWindow.xaml: </p>
  
  <pre><code>&lt;DataGrid x:Name="dgVarConfig" 
      HorizontalAlignment="Left" 
      Margin="10,59,0,0" 
      VerticalAlignment="Top" 
      Height="403" 
      Width="1278" 
      AutoGenerateColumns="False" 
      CanUserAddRows="False" 
      CanUserDeleteRows="False" 
      CanUserResizeRows="False" 
      HeadersVisibility="Column"&gt;
  
      &lt;DataGrid.Columns&gt;
          &lt;DataGridTextColumn 
              HeaderStyle="{StaticResource columnHeaderButton}"
              Width="auto" 
              Header="Match Ausdruck" 
              Binding="{Binding match_expression}"&gt;
          &lt;/DataGridTextColumn&gt;
      &lt;/DataGrid.Columns&gt;
  &lt;/DataGrid&gt;
  </code></pre>