2014-10-06 62 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

相关问题