Windows Phone ApplicationBar BackgroundColor 属性样式 XamlParseException
我的应用程序中有很多页面,我决定在 App.Resources 中创建一个全局 ApplicationBar 样式:
<Style TargetType="shell:ApplicationBar">
<Setter Property="BackgroundColor" Value="#006699" />
</Style>
但是,当我尝试启动应用程序时,VS 给了我一个错误:
The property 'BackgroundColor' was not found in type 'Microsoft.Phone.Shell.ApplicationBar'.
这不是真的 - ApplicationBar.BackgroundColor属性。有什么问题吗?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我相信,ApplicationBar 属性不能使用
Binding
或按照您尝试的方式设置样式,因为它不是 silverlight 控件。尽管您可以将整个
applicationbar 作为资源。就像这样编辑:
或者,如果您希望更改应用程序栏颜色,您可以将其放入资源中。
并从后面的代码添加按钮。不过,我还没有遇到过这种情况有帮助的情况。
I believe, ApplicationBar properties cannot use
Binding
or styling the way you're trying, as it is not a silverlight control. Although you can put thewhole
applicationbar as a resource. Like soEDIT:
Or you could just put this in the resource if you want your application bar color to change.
And add buttons from code behind. although, I haven't come across a scenario where this would help.