Color vs SolidColorBrush for a StyledProperty #15581
-
Hello everyone, I am very new to Avalonia and I am trying to port a user control originally designed for WPF I am now using Color instead of brushes and the control does work but setting up the color is somewhat annoying for client code: Any suggestions ? Or am I doing something wrong with the brushes ? Complete solution for .net 8 is here: https://github.com/LaurentInSeattle/AvaloniaExperiments |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
The <ctrl:SvgIcon Foreground="#FF0000" />
<ctrl:SvgIcon Foreground="Red" /> |
Beta Was this translation helpful? Give feedback.
The
Background
andForeground
dependency properties should takeIBrush
instead ofBrush
orColor
. Then just use it like normal, eg: