[英]Problem with Visual Studio WPF Designer! :(
為什么我收到此錯誤:
'{DependencyProperty.UnsetValue}' is not a valid value for the 'System.Windows.Controls.Panel.Background' property on a Setter.
我確定所有控件樣式,設置好,但Visual Studio Designer顯示此錯誤! :'(我確信代碼沒問題,我不想用很多代碼填充你的瀏覽器屏幕......
我多次看到這個錯誤,我不知道如何調試它! 請幫幫我,如果你有一些調試技巧!
編輯:
在Player.xaml(UserControl)中:
<Button Height="40" Name="btnNext" Style="{StaticResource ResourceKey=NextButton}" Click="btnNext_Click" />
在我重建項目之后,我在#: - s上面的行上看到了錯誤
在Constants.xaml中:
<ImageBrush x:Key="nextImage" ImageSource="../Images/next.png" />
在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>
提前致謝...:)
嘿!
最后我解決了! 我只是將每個StaticResource
更改為DynamicResource
,現在一切都很好!
將StaticResource
更改為DynamicResource
,但不將其更改為基本控件。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.