包含在WinRT中常见的风格让我无法找到资源的名称/密钥AppBarButtonStyle
公共资源包括在我的App.xaml异常
<Button Style="{StaticResource AppBarButtonStyle}" />
这个基本的代码火灾Cannot find a Resource with the Name/Key AppBarButtonStyle
例外,我可以浏览这种风格的定义。
我在这里错过了一些非常大的东西吗?
PS:我已经试过重新启动VS
包含在WinRT中常见的风格让我无法找到资源的名称/密钥AppBarButtonStyle
公共资源包括在我的App.xaml异常
<Button Style="{StaticResource AppBarButtonStyle}" />
这个基本的代码火灾Cannot find a Resource with the Name/Key AppBarButtonStyle
例外,我可以浏览这种风格的定义。
我在这里错过了一些非常大的东西吗?
PS:我已经试过重新启动VS
这里有你的三个可能的原因:
的App.xaml应该是这个样子:
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Common/StandardStyles.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
祝您好运!
我遇到这个问题是在一个单独的资源字典里定义
<Button Style="{StaticResource AppBarButtonStyle}" />
如果将其放到某个页面的Xmal位内部的资源里,OK。
我解决这个问题是在资源字典头部添加
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Common/StandardStyles.xaml"/>
</ResourceDictionary.MergedDictionaries>
我通过我以前的风格定制,扩展AppBarButtonStyle定义AppBarButtonStyle固定它。
在Windows 8.1中,包含AppBarButtonStyle的StandardStyles.xaml文件已被删除。相反,你可以使用AppBarButton如下所示:
<AppBarButton Icon="Play" Label="Play" />
检查本文由Tim Heuer豪雅: http://timheuer.com/blog/archive/2013/10/29/remove-standardstyles-xaml-from-windows-8-1-winrt-projects.aspx
任何机会,你可以用英文吗? –