构建错误 - 隐藏继承的成员 [英] Build error - Hides inherited member
问题描述
我正在尝试构建一个简单的项目 - 没有动作的单页。 我在screen_1.xaml上遇到了构建错误
I'm trying to build a simple project - single page w/ no actions yet. I'm getting a build error on screen_1.xaml
'WfpPrototype1Screens.Screen_1.Background'隐藏了继承的成员'System.Windows.Controls.Control.Background'。 如果想要隐藏,请使用新关键字。
'WfpPrototype1Screens.Screen_1.Background' hides inherited member 'System.Windows.Controls.Control.Background'. Use the new keyword if hiding was intended.
任何有关如何解决的建议都将受到赞赏。
Any suggestions on how to resolve would be appreciated.
推荐答案
我遇到了同样的错误。我在Window控件中有一个名为"Background"的网格。显然这是一个属性,所以在名为"背景"的窗口中创建一个对象会让代码变得愤怒。
I was getting this same error. I had a grid named 'Background' within the Window control. Apparently this is a property, so creating an object in the window named 'Background' made the code gods angry.
只需重命名你的"背景"对象为"Grid_Background"或其他任何内容,警告将神奇地消失。
Just rename your 'Background' object to 'Grid_Background' or whatever and the warning will magically go away.
这篇关于构建错误 - 隐藏继承的成员的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!