2014-10-06 41 views

回答

0

我認爲你可以使用鍵和值以下的ResourceDictionary實例的屬性。

string exeFilePath = System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase; 
string exeDirPath = System.IO.Path.GetDirectoryName(exeFilePath); 
string targetFile = "subFolder\\ResourceDictionary.xaml"; 
string dictionaryPath = new Uri(System.IO.Path.Combine(exeDirPath, targetFile)).LocalPath; 
string xamlString = File.ReadAllText(dictionaryPath); 
ResourceDictionary resourceDictionary = (ResourceDictionary)XamlReader.Parse(xamlString); 
+0

感謝您的回覆,但我的意思是在設計模式,我想說明的鍵和值在ListView,像用戶控件可以對其進行編輯,在Visual Studio設計,你可以在代碼編輯。所以我想在設計時爲我的資源字典制作可視化視圖。 – 2014-10-06 09:49:57

相關問題