title: Change border Brush WPF
body: <p>Hi there i am new to WPF.I have applied round corner text box by using </p>
  
  <pre><code>&lt;Window.Resources&gt; 
  </code></pre>
  
  <p>saw on some website do not know if it is best.</p>
  
  <p>Now i may have 4 text boxes all having round corners
  I have selected a border brush color and want that it should change when ever the some particular textbox has focus.so i added event </p>
  
  <pre><code>private void textBox1_GotFocus(object sender, RoutedEventArgs e)
          {
              textBoxCpanelUserName.BorderBrush = Brushes.OrangeRed;           
          }
  </code></pre>
  
  <p>but no effect.I checked when text box has focus the event fires but never changes the value of border brush.</p>
  
  <p>Following is my XMAL</p>
  
  <pre><code>&lt;Window x:Class="AutomatingSomething.MainWindow"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"       
          Title="MainWindow" Height="600" Width="800" Name="MainContainer" xmlns:my="clr-namespace:WPFControls.Clocks;assembly=WPFControls" xmlns:common="clr-namespace:WPF.Common"&gt;
      &lt;Window.Resources&gt;
          &lt;ControlTemplate x:Key="TextBoxBaseControlTemplate" TargetType="{x:Type TextBoxBase}"&gt;
              &lt;Border Background="{TemplateBinding Background}" 
                  x:Name="Bd" BorderBrush="#FF3BB5C8"
                  BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="7"&gt;
                  &lt;ScrollViewer x:Name="PART_ContentHost"/&gt;                
              &lt;/Border&gt;
  
              &lt;ControlTemplate.Triggers&gt;
  
                  &lt;Trigger Property="Width" Value="Auto"&gt;
                      &lt;Setter Property="MinWidth" Value="100"/&gt;
                  &lt;/Trigger&gt;
                  &lt;Trigger Property="Height" Value="Auto"&gt;
                      &lt;Setter Property="MinHeight" Value="20"/&gt;
                  &lt;/Trigger&gt;
  
              &lt;/ControlTemplate.Triggers&gt;
          &lt;/ControlTemplate&gt;
      &lt;/Window.Resources&gt;
      &lt;Grid Name="MasterGrid"&gt;        
          &lt;Grid.Background&gt;
              &lt;LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"&gt;
                  &lt;GradientStop Color="#FF484848" Offset="0.075" /&gt;
                  &lt;GradientStop Color="#FF8A8A8A" Offset="1" /&gt;
              &lt;/LinearGradientBrush&gt;
          &lt;/Grid.Background&gt;
          &lt;Border BorderBrush="Silver" BorderThickness="0" Height="45" HorizontalAlignment="Left" Margin="902,12,0,0" Name="border1" VerticalAlignment="Top" Width="88"&gt;
              &lt;my:RetroClock Name="retroClock1" FontSize="28" FontWeight="Normal" /&gt;
          &lt;/Border&gt;
          &lt;Button Content="Button" Name="button1" Margin="12,25,907,608" Click="button1_Click" /&gt;
          &lt;Grid common:VisibilityAnimation.AnimationType="Fade" Height="524" HorizontalAlignment="Left" Margin="101,25,0,0" Name="CpanelSettings" VerticalAlignment="Top" Width="665"&gt;
              &lt;Grid.Background&gt;
                  &lt;LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"&gt;
                      &lt;GradientStop Color="#FFD4D4D4" Offset="0" /&gt;
                      &lt;GradientStop Color="#FF797979" Offset="1" /&gt;
                  &lt;/LinearGradientBrush&gt;
              &lt;/Grid.Background&gt;
              &lt;Label Content="Cpanel Settings" Height="38" HorizontalAlignment="Left" Margin="289,6,0,0" Name="label1" VerticalAlignment="Top" FontWeight="Bold" FontSize="26" FontFamily="Tekton Pro" FontStretch="Condensed" Width="147"&gt;
                  &lt;Label.Foreground&gt;
                      &lt;LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"&gt;
                          &lt;GradientStop Color="Black" Offset="0" /&gt;
                          &lt;GradientStop Color="#FFB4AFAF" Offset="1" /&gt;
                      &lt;/LinearGradientBrush&gt;
                  &lt;/Label.Foreground&gt;
              &lt;/Label&gt;
              &lt;TextBox Height="30" HorizontalAlignment="Left" Margin="132,50,0,0" Name="textBoxCpanelUserName" VerticalAlignment="Top" Width="187" FontFamily="Tekton Pro" FontWeight="Bold" BorderThickness="2" Template="{StaticResource TextBoxBaseControlTemplate}" FontSize="15" BorderBrush="#FF3BB5C8" GotFocus="textBox1_GotFocus" /&gt;
              &lt;Label Content="Cpanel Settings" FontFamily="Tekton Pro" FontSize="20" FontStretch="Condensed" FontWeight="Bold" Height="34" HorizontalAlignment="Left" Margin="6,46,0,0" Name="label2" VerticalAlignment="Top" Width="120"&gt;
                  &lt;Label.Foreground&gt;
                      &lt;LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"&gt;
                          &lt;GradientStop Color="Black" Offset="0" /&gt;
                          &lt;GradientStop Color="#FFB4AFAF" Offset="1" /&gt;
                      &lt;/LinearGradientBrush&gt;
                  &lt;/Label.Foreground&gt;
              &lt;/Label&gt;
          &lt;/Grid&gt;
      &lt;/Grid&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <p>I have one more question that if i draw new textbox and try to make its corner round by the drawn template then if i change the color on one textbox on focus all get updated?(i donot want that)</p>
  
  <hr>
  
  <p><strong>I am extremely sorry if i have said any non-technical thing or said the things wrong.Its because i am totaly new to wpf</strong></p>
  
  <hr>