WPF 动态资源:警告消息 - “资源“资源”;无法解决。”
基本上,我有一个使用动态资源的用户控件。该应用程序使用该资源编译并运行良好,但看到此警告消息有点烦人。这让我想知道我是否做对了,这只是一个误报,或者我是否做错了,碰巧从工作中的裂缝中溜走了。
<Grid Background="{DynamicResource AppDefaultBackgroundColor}">
...
</Grid>
那么,如果我正确使用它,我怎样才能摆脱这个警告消息?
如果我没有正确使用它,它应该是什么样子,这样我就不会收到警告?
PS 我的应用程序工作并运行良好,但我不希望在编译时出现任何编译警告。
Basically, I have a UserControl that uses a DynamicResources. The application compiles and runs fine using that resource, but it's a bit annoying to see this warning message. It makes me wonder if I'm doing it right and it's just a false positive, or if I'm doing it wrong and happen to slip through the cracks in it working.
<Grid Background="{DynamicResource AppDefaultBackgroundColor}">
...
</Grid>
So, if I used it correctly, how can I get rid of this warning message?
If I did not use it appropriately, what should it look like so I don't get a warning?
P.S. My application works and runs fine, but I prefer to not have any compilation warnings when compiling.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以像这样映射您的资源
Theme.xaml 必须包含 'AppDefaultBackgroundColor' 像这样
You can map your resource like this
Theme.xaml must contain 'AppDefaultBackgroundColor' like this