How to change Border Color of TextBox on Focus in UWP

I am developing an Universal Windows Platform App using XAML & C#. I want to change Border Color of TextBox on Focus in UWP.

Thanks in advance for Help.


ANSWERS:


You need to edit the Style of your TextBox, the default one you can generate via designer or take from MSDN. There in visual states you will find Focused - change whatever you want in it:

<VisualState x:Name="Focused">
   <Storyboard>
      ... some code
        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement"
                                       Storyboard.TargetProperty="BorderBrush">
           <DiscreteObjectKeyFrame KeyTime="0" Value="Green"/>
        </ObjectAnimationUsingKeyFrames>
      ... some code
   </Storyboard>
</VisualState>

Well it is actually very simple to achieve, just follow these steps:


Step 1. add a textbox to your page.


step 2. right click on your textbox and pick : "EditTemplate" \ "Edit a Copy..."

this will take you to the template designer stage.


step 3. check this image:



 MORE:


 ? How to convert string to image.source in UWP?
 ? Viewport3D not support UWP
 ? Windows 10 (UWP) manifest issue
 ? Windows 10 (UWP) manifest issue
 ? Windows 10 (UWP) manifest issue
 ? UWP windows 10 Visibility Binding to a global Variable
 ? UWP Manifest issue / restricted capability / inputForegroundObservation
 ? UWP X:Bind and Design Time Data
 ? UWP X:Bind and Design Time Data
 ? UWP X:Bind and Design Time Data