title: WPF button template in app.xaml how to set the text in MainWindow.xaml
body: <p>I have created a glass button in the app.xaml file (code bottom of this post). I have a few buttons that reference this template in the mainwindox.xaml. What I do not know how to do is set the text that the button displays from within the MainWindow. The first section of code below is an example of one of the buttons. Somewhere I need to add some code so the button has the text 'Correlation' on it. </p>
  
  <p><strong>Main Window code below</strong></p>
  
  <pre><code> &lt;Button Grid.Column="0" Grid.Row="1" Style="{StaticResource buttBasicTemplateReport}" Command="{Binding CommandButtReportsCorrel}" Height="50" Width="120" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,0,0,0"/&gt;                    
  </code></pre>
  
  <p><strong>App.xaml Code below</strong></p>
  
  <pre><code>         &lt;!-- Glass Button empty template Report --&gt;
      &lt;Style x:Key="buttBasicTemplateReport" TargetType="Button"&gt;
          &lt;Setter Property="Cursor" Value="Hand"/&gt;
          &lt;Setter Property="FontSize" Value="12" /&gt;
          &lt;Setter Property="Foreground" Value="White"/&gt;
          &lt;Setter Property="FontWeight" Value="Bold"/&gt;
          &lt;Setter Property="VerticalAlignment" Value="Center"/&gt;
          &lt;Setter Property="Template"&gt;
              &lt;Setter.Value&gt;
                  &lt;ControlTemplate TargetType="{x:Type Button}"&gt;
                      &lt;Border x:Name="ButtonBorder" 
                                CornerRadius="15,15,15,15" 
                                BorderThickness="3,3,3,3" 
                                Background="#AA000000"  
                                BorderBrush="#99FFFFFF"
                                RenderTransformOrigin="0.5,0.5"&gt;
                          &lt;Grid&gt;
                              &lt;Grid.RowDefinitions&gt;
                                  &lt;RowDefinition Height="*"/&gt;
                                  &lt;RowDefinition Height="1.7*"/&gt;
                              &lt;/Grid.RowDefinitions&gt;
                              &lt;Grid.ColumnDefinitions&gt;
                                  &lt;ColumnDefinition/&gt;
                                  &lt;ColumnDefinition/&gt;
                              &lt;/Grid.ColumnDefinitions&gt;
                              &lt;Border Grid.Row="0" Grid.ColumnSpan="2" CornerRadius="23,23,0,0"&gt;
                                  &lt;Border.Background&gt;
                                      &lt;LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"&gt;
                                          &lt;GradientStop Color="#08FFFFFF" Offset="0"/&gt;
                                          &lt;GradientStop Color="#88FFFFFF" Offset="1"/&gt;
                                      &lt;/LinearGradientBrush&gt;
                                  &lt;/Border.Background&gt;
                              &lt;/Border&gt;
                              &lt;ContentPresenter x:Name="ButtonContentPresenter"
                              VerticalAlignment="Center"  
                              Grid.RowSpan="2" 
                              HorizontalAlignment="Center"/&gt;
                              &lt;Rectangle x:Name="recGlow"  Style="{StaticResource recSecurity}"
                                         Grid.Row="0" Grid.RowSpan="2" Grid.Column="0" Grid.ColumnSpan="2"/&gt;
                              &lt;TextBlock Grid.Row="0" Grid.RowSpan="2" Grid.ColumnSpan="2" VerticalAlignment="Center" HorizontalAlignment="Center" Style="{StaticResource txtSecurity}"/&gt;
                          &lt;/Grid&gt;
                      &lt;/Border&gt;
                      &lt;ControlTemplate.Triggers&gt;
                          &lt;Trigger Property="IsMouseOver"  Value="True"&gt;
                              &lt;Setter TargetName="recGlow" Property="Opacity" Value="0.8"/&gt;
                              &lt;Setter Property="RenderTransform" TargetName="ButtonBorder"&gt;
                                  &lt;Setter.Value&gt;
                                      &lt;TransformGroup&gt;
                                          &lt;ScaleTransform ScaleX="1" ScaleY="1"/&gt;
                                      &lt;/TransformGroup&gt;
                                  &lt;/Setter.Value&gt;
                              &lt;/Setter&gt;
                          &lt;/Trigger&gt;
                      &lt;/ControlTemplate.Triggers&gt;
                  &lt;/ControlTemplate&gt;
              &lt;/Setter.Value&gt;
          &lt;/Setter&gt;
      &lt;/Style&gt;
  </code></pre>