2012-10-21 55 views

回答

2

使用"{StaticResource name}"就像你會與<Page.Resources>

要存儲資源,創建<ResourceDictionary.MergedDictionaries><ResourceDictionary>,把你的資源在。

例如:

<Application.Resources> 
    <ResourceDictionary> 
     <ResourceDictionary.MergedDictionaries> 

      <!-- 
       Styles that define common aspects of the platform look and feel 
       Required by Visual Studio project and item templates 
      --> 
      <ResourceDictionary Source="Common/StandardStyles.xaml"/> 
      <ResourceDictionary> 
       <x:String x:Key="Foo">Bar</x:String> 
      </ResourceDictionary> 
     </ResourceDictionary.MergedDictionaries> 
    </ResourceDictionary> 
</Application.Resources> 
相關問題