Why am I getting this error:
'{DependencyProperty.UnsetValue}' is not a valid value for the 'System.Windows.Controls.Panel.Background' property on a Setter.
I am sure that all the styles of the controls are well set, but Visual Studio Designer displays this error !: '(I am sure that the code is in order, and I do not want to have many codes on your browser screen ...
I have seen this error many times and I donβt know how to debug it! Please help me if u khow some debugging tips!
Edition:
in Player.xaml (UserControl):
<Button Height="40" Name="btnNext" Style="{StaticResource ResourceKey=NextButton}" Click="btnNext_Click" />
After I rebuild the project, I saw an 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...:)
c # visual-studio wpf
Jalal
source share