Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problem with Visual Studio WPF Designer! :(

Why i get this error:

'{DependencyProperty.UnsetValue}' is not a valid value for the 'System.Windows.Controls.Panel.Background' property on a Setter.

I'm sure that all controls styles, set well, But Visual Studio Designer display this error! :'( I'm sure that code is OK, and i don't want fill your browser screen with a lots of codes...

I saw this error many times, and i don't know how debug it! Please help me, If u khow some debug tips!

EDITED:

in Player.xaml(UserControl):

<Button Height="40" Name="btnNext"  Style="{StaticResource ResourceKey=NextButton}" Click="btnNext_Click" />

After i Rebuild the project, i saw error on the line above #:-s

in Constants.xaml:

<ImageBrush x:Key="nextImage" ImageSource="../Images/next.png" />

in Generic.xaml:

 <Style TargetType="{x:Type Button}" x:Key="NextButton">
        <Setter Property="Background" Value="{StaticResource ResourceKey=nextImage}" />
        <Setter Property="Template" Value="{StaticResource ResourceKey=PlayerButtonTemplate}" />
    </Style>

Thanks in advance...:)

like image 202
Jalal Avatar asked Feb 14 '11 21:02

Jalal


1 Answers

Heh!

Finally I solve that! I just change every StaticResource to DynamicResource, and every thing is fine now!

like image 196
Jalal Avatar answered Sep 23 '22 11:09

Jalal