I have an application in which I’m using a specific ResourceDictionary for my strings and I need to duplicate the keys of that ResourceDictionary in a class as string constants. While it’s easy to just copy and paste, I’m expecting around 350 resource strings, and having to manage both files having all the content isn’t an option.
I want to code an app that would have a Key/Value grid for which the user would enter the values, and that app would write in the Xaml file and in the .cs constant class. I have no problem with the .cs file, but is there a way to write to a xaml file without having to clear the file before writing the contents of the new file?
Thanks
You could write a T4 template that uses a simple designer (WPF usercontrol) or xml file to generate the xaml and C# files.
Excellent T4 tutorials by Oleg Sych
Here is how to generate multiple files with T4