0
我想用我的自定義設計視圖來顯示我的資源字典項目,我想使ListView
顯示帶有值的鍵。並可以通過設計視圖進行編輯。 -i希望能夠在visual studio desiner中編輯我的字典。如何在設計視圖中顯示資源字典項目?
我想用我的自定義設計視圖來顯示我的資源字典項目,我想使ListView
顯示帶有值的鍵。並可以通過設計視圖進行編輯。 -i希望能夠在visual studio desiner中編輯我的字典。如何在設計視圖中顯示資源字典項目?
我認爲你可以使用鍵和值以下的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);
感謝您的回覆,但我的意思是在設計模式,我想說明的鍵和值在ListView,像用戶控件可以對其進行編輯,在Visual Studio設計,你可以在代碼編輯。所以我想在設計時爲我的資源字典制作可視化視圖。 – 2014-10-06 09:49:57