我已经设法使这个工作使用以下步骤:
>使用名为“WP7ExternalResourcesTest”的“Windows Phone应用程序”应用程序模板创建标准的WP7应用程序.
>使用名为“WP7ExternalResourcesTestLibrary”的“Windows Phone Class Library”模板将项目添加到同一个解决方案.
>从库项目中删除默认的Class.cs文件.
>使用“XML文件”模板添加一个名为“External.xaml”的文件,并将“Build Action”设置为“Page”.
>将新的XAML添加到新的XAML文件中:
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
>构建库项目,然后从WP7ExternalResourcesTest项目中添加对它的引用.
>在WP7ExternalResourcesTest中,打开App.xaml并将Application.Resources部分更改为以下内容:
>在MainPage.xaml中,将Foreground =“{StaticResource ForegroundBrush}”添加到名为“PageTitle”的TextBlock中.
在模拟器中运行应用程序.最终的结果是TextBlock正确地将红色的“page name”显示出来.
希望这可以帮助.