In order to achieve this you should have an understanding how a WPF TextBox is actually constructed.
See here:
wpf/TextBox.xaml at c271205b80c27df976acbd7236ec637090d127c1 · dotnet/wpf · GitHub[
^]
According to this you can change the border colour by using a trigger which reacts on the IsFocused property.
<Style TargetType="TextBox">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TextBox}">
<Border x:Name="Border"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}">
<ScrollViewer x:Name="PART_ContentHost"
Focusable="false"
HorizontalScrollBarVisibility="Hidden"
VerticalScrollBarVisibility="Hidden">
</ScrollViewer>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsFocused" Value="true">
<Setter Property="BorderBrush"
TargetName="Border"
Value="Green">
</Setter>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
Now it's up to you to set the IsFocused property to true,
when starting the dialogue.