2010-07-14 38 views
0

這可行,但我認爲我沒有做對。WPF:你能否讓這個資源聲明不那麼冗長?

<UserControl.Resources> 
    <ResourceDictionary> 
     <ResourceDictionary.MergedDictionaries> 
      <ResourceDictionary Source="pack://application:,,,/Aam.Gui;component/AamBlue.xaml" /> 
      <ResourceDictionary> 
       <gui:RepKeyValueConverter x:Key="RepKeyValueConverter"/> 
      </ResourceDictionary> 
     </ResourceDictionary.MergedDictionaries> 
    </ResourceDictionary> 
</UserControl.Resources> 

回答

3

您可以直接在外部資源字典內聲明的資源,並保存自己1雙ResourceDictionary標籤:

<UserControl.Resources> 
    <ResourceDictionary> 
     <ResourceDictionary.MergedDictionaries> 
      <ResourceDictionary Source="pack://application:,,,/Aam.Gui;component/AamBlue.xaml" /> 
     </ResourceDictionary.MergedDictionaries> 
     <gui:RepKeyValueConverter x:Key="RepKeyValueConverter"/> 
    </ResourceDictionary> 
</UserControl.Resources> 
相關問題