カスタム デザイン ビューでリソース ディクショナリ アイテムを表示したいのですがListView
、キーと値を表示するようにしたいと考えています。デザインビューで編集できます。- Visual Studio desiner 内で自分の辞書を編集できるようにしたい。
1 に答える
0
以下の resourceDictionary インスタンスの Keys プロパティと Values プロパティを使用できると思います。
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);
于 2014-10-06T09:40:20.157 に答える