Есть и второй способ: самостоятельно создать цвет в конструкторе, но тогда как присвоить его в коде?
...
<Border Background={Binding BorderBrush} />
...
class MyControl
{
public MyControl()
{
BorderBrush = new SolidColorBrush(youColor);//youColor - создаете свой цвет классом Color.
}
public Brush BorderBrush {get; private set;}
}
string sql = @"SELECT ""ID_TagName"",
""F_ComPort"",
""F_ComPortBaudRate"",
""F_ComQuery"",
""F_ParseFunction"",
""F_TagReadTime"",
""F_AnswerLenght"",
""F_AnswerKey"",
""F_AnswerKeyPosition"",
""F_ComPortIPAdress"",
""F_ComPortParity"",
""F_ComPortDataBits"",
""F_ComPortStopBit"",
""F_ComPortFlowControl"",
""F_ComPortTimeOut""
FROM ""SC_Tag"".""T_TagName"" AS tn,
""SC_Tag"".""T_HardWareTag"" AS hw,
""SC_Tag"".""T_RealHardWare"" AS rh
WHERE rh.""ID_RealHardWare"" = hw.""F_RealHardWare_ID""
AND tn.""F_HardWare_ID"" = hw.""F_TagName_ID""
AND ""F_ComPortIPAdress"" = '127.0.0.1'
AND lower(""F_ServerName"") =lower('" + Name + "')";