The BorderBrush property just defines the colour of the border, to set the thickness you'll have to set the BorderThickness property.
A better way of doing this would be to set the Style property in the converter instead, that way you can use a single converter to set the border brush, thickness and any other properties you might want to amend such as the font colour etc.
If you define your style within a xaml resource dictionary, you can load it from within your converter like so...
public class TextboxStyleConverter : IValueConverter
{
public object Convert(
object value, Type targetType, object parameter,
System.Globalization.CultureInfo culture)
{
if(some condition is true)
return (Style)Application.Current.FindResource("MyStyle1");
else
return (Style)Application.Current.FindResource("MyStyle2");
}
public object ConvertBack(object value, Type targetType, object parameter,
System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
}
This way you can just define the styles you need and load the appropriate one from within your converter class.
The best way to define your style is within a Resource Dictionary - this is just a xaml file within your solution. See below for an example...
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style TargetType="{x:Type TextBlock}" x:Key="Style1">
<Setter Property="BorderBrush" Value="DarkGrey" />
<Setter Property="BorderThickness" Value="1" />
</Style>
<Style TargetType="{x:Type TextBlock}" x:Key="Style2">
<Setter Property="BorderBrush" Value="Red" />
<Setter Property="BorderThickness" Value="2" />
</Style>
</ResourceDictionary>
If you want to keep your ResourceDictionary in a separate file so that it can be easily referenced by multiple Windows / UserControls, you need to include it in your Window.Resources / UserControl.Resources on each xaml file where it is to be used. If you are including multiple resources, you need to use the tag (see below), otherwise just leave out that part and include your ResourceDictionary on it's own within the tags.
<Window>
<Window.Resources>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../ResourceDictionary1.xaml" />
<ResourceDictionary Source="../ResourceDictionary2.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources>