1

I want to display my resource dictionary items with my custom design view, i want to make a ListView to show the keys with the values. and can edit withing the design view. -i want to be able to edit my dictionary within visual studio desiner.

i want to be able to edit my dictionary within visual studio desiner

Henka Programmer
  • 433
  • 6
  • 18

1 Answers1

0

I think you can use Keys and Values properties of resourceDictionary instance below.

 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);
Abdurrahman Alp Köken
  • 1,236
  • 1
  • 13
  • 12
  • thanks for your reply, but i mean in design mode, i want to show the keys and values in a listview, like usercontrol you can edit it, in visual studio designer and you can edit it in code. so i want to make a visual view for my resource dictionary at design time. – Henka Programmer Oct 06 '14 at 09:49