C# 在Universal App中使用共享资源xaml文件的WinRT
我在Visual Studio 2013中创建了一个通用Windows应用商店应用程序。我创建了一个名为C# 在Universal App中使用共享资源xaml文件的WinRT,c#,xaml,windows-phone-8,windows-runtime,C#,Xaml,Windows Phone 8,Windows Runtime,我在Visual Studio 2013中创建了一个通用Windows应用商店应用程序。我创建了一个名为AllButtonShapes.xaml的ResourceDictionary文件。在我的应用程序的共享部分中,app.xaml文件包含以下内容: <Application.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries>
AllButtonShapes.xaml的ResourceDictionary
文件。在我的应用程序的共享部分中,app.xaml
文件包含以下内容:
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="AllButtonShapes.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
在应用程序的Windows部分,这很好,我的应用程序能够找到AllButtonShapes.xaml
中定义的资源。但是,当我尝试启动应用程序的Windows Phone部分时,找不到这些资源
如何让我的通用应用程序的Windows Phone部分查看我的应用程序资源中定义的资源?尝试使用绝对路径
<ResourceDictionary Source="/AllButtonShapes.xaml"/>
老实说,我无法重现这个问题。您可以尝试检查字典的生成操作,它必须设置为Page
。可能是名字冲突或其他原因。你能分享你的项目文件吗?。我刚刚创建了一个新项目,它在那个项目中发挥了作用。嗯,我想我的项目文件一定有问题。没关系,这是一个测试项目,我可以在这里解决问题。我计划创建一个新的项目,一旦把事情安排妥当,就复制代码。