To the property BorderBrush
you have to assign a Brush (as you could guess by its name).
One kind of Brush
is a LinearGradientBrush
(the thing which makes a gradient between colors)
SolidColorBrush
is another kind of Brush which could also get assigned.
As it looks as this kind of control you use has already assigned a LinearGradientBrush
.
Now you can assign a Brush of your choice and override the already set Brush
.
Example for a LinearGradientBrush
:
<TextBox>
<TextBox.BorderBrush>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
<GradientStop Color="Black" Offset="0.0" />
<GradientStop Color="White" Offset="1" />
</LinearGradientBrush>
</TextBox.BorderBrush>
</TextBox>
If you want your border just in a a solid color you can also use a SolidColorBrush
.
<TextBox.BorderBrush>
<SolidColorBrush Color="Red" />
</TextBox.BorderBrush>
or just use the existing Converter Color --> SolidColorBrush
<TextBox BorderBrush="Red" Text="bla bla" />
EDIT:
And if you want that all your controls have the same Border you can add a Brush to the ResourceDictionary
of a container object and reuse it for all the controls...
<!-- Add the Brush as resource to the surrounding window -->
<Window.Resources>
<SolidColorBrush x:Key="controlBorderBrush" Color="Gray" />
</Window.Resources>
<!-- -->
<TextBlock BorderBrush="{StaticResource controlBorderBrush}" Text="huhuuu" />
<otherlib:SpecialTextBlockWithOverriddenProps BorderBrush="{StaticResource controlBorderBrush}" Text="hahaaaaaaa" />