I’m new to WPF and still having some basic problems.
I have a control from devcomponents that defaults to a blue border. My textboxes etc. have a more grey colour. I want the devcomponents control to have the same border.
I look in the properties of a TextBox and see that BorderBrush is set to “System.Windows.Media.LinearGradientBrush” yet I can’t put –
<WpfEditors:IntegerInput BorderBrush="System.Windows.Media.LinearGradientBrush"...
In fact, I can’t put –
<TextBox BorderBrush="System.Windows.Media.LinearGradientBrush" ...
What magic am I missing?
Thanks.
To the property
BorderBrushyou have to assign a Brush (as you could guess by its name).One kind of
Brushis aLinearGradientBrush(the thing which makes a gradient between colors)SolidColorBrushis 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:If you want your border just in a a solid color you can also use a
SolidColorBrush.or just use the existing Converter Color –>
SolidColorBrushEDIT:
And if you want that all your controls have the same Border you can add a Brush to the
ResourceDictionaryof a container object and reuse it for all the controls…