繁体   English   中英

Visual Studio WPF设计器的问题! :(

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM