Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

#FFFAFAFA is not valid value for the system.windows.controls.panel.background

Tags:

wpf

xaml

Im just writing my own personal styles. Everything is ok, no error inside styles.

I have following code

<Color x:Key="DialogButtonBorderBrushColor" A="255" R="177" G="177" B="177" />

<SolidColorBrush x:Key="BorderBrush" Color="{StaticResource DialogButtonBorderBrushColor}" />

There is a style for my dialog button.

<Style x:Key="DialogButtonStyle" TargetType="Button">
    <Setter Property="MinWidth" Value="80" />
    <Setter Property="MinHeight" Value="30" />
    <Setter Property="BorderBrush" Value="{StaticResource BorderBrush}" />
    <Setter Property="BorderThickness" Value="1" />
    <Setter Property="Background" Value="{StaticResource DialogButtonBackgroundColor1}"/>
</Style>

Im just using this dialogButtonStyle in xaml Button as a style. But when I use this style I get following error:

#FFFAFAFA is not a valid value for the System.Windows.Controls.Panel.Background property on setter.

I have really no idea what to do with this. Can you help me? Thanks.

like image 547
Daniel Capek Avatar asked Oct 19 '25 01:10

Daniel Capek


1 Answers

<Setter Property="Background" Value="{StaticResource DialogButtonBackgroundColor1}"/>

Background property expects Brush value. Judging by the name of resource, DialogButtonBackgroundColor1 is a Color. You should use Brush resource similar to BorderBrush

like image 98
ASh Avatar answered Oct 21 '25 22:10

ASh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!