tags:

views:

151

answers:

1

Theres a problem. I can't set value of BorderBrush fros C#-code (not in XAML):

 ((Border)((Image)sender).Parent).BorderBrush = "#FFBCC7D8";

How to solve this problem?

+2  A: 

You must use an Converter to convert the string to a Brush-Object. In the Framework there is a BrushConverter to do this.

BrushConverter converter = new BrushConverter();
((Border)((Image)sender).Parent).BorderBrush = converter.ConvertFromString("#FFBCC7D8") as Brush;
Jehof