Answer the question
In order to leave comments, you need to log in
WPF color assignment?
There is a Border element whose color needs to be changed. How to give it the value #FF3399FF ? (not in XAML)
There is a second way: create the color yourself in the constructor, but then how to assign it in the code?
Answer the question
In order to leave comments, you need to log in
There is a second way: create the color yourself in the constructor, but then how to assign it in the code?
...
<Border Background={Binding BorderBrush} />
...
class MyControl
{
public MyControl()
{
BorderBrush = new SolidColorBrush(youColor);//youColor - создаете свой цвет классом Color.
}
public Brush BorderBrush {get; private set;}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question