Your start was pretty good. Using LocBaml was too complicated for me too. So I had to figure out something easier for me. Here's solution: first, you have to create resource .resx file (this step is already done in your); Simple way to get all strings from resource file is to store it in dictionary. You can do it using this method:
public Dictionary<string, string> ApplicationStrings(string locale)
{
Dictionary<string, string> result = new Dictionary<string, string>();
ResourceManager manager = null;
// Here is two locales (custom and english locale), but you can use more than two if there's a need
if (locale == "Your locale")
{
manager = new ResourceManager(typeof(your_locale_resource_file));
}
else
{
manager = new ResourceManager(typeof(ApplicationStrings_en));
}
ResourceSet resources = manager.GetResourceSet(CultureInfo.CurrentCulture, true, true);
IDictionaryEnumerator enumerator = resources.GetEnumerator();
while (enumerator.MoveNext())
{
result.Add((string)enumerator.Key, (string)enumerator.Value);
}
return result;
}
You have to set DataContext of MainWindow as this method result and bind all you strings to the dictionary.
Binding example:
Text="{Binding [YourKey]}"
You can call this method and then change DataContext whenever and wherever you want. Thanks to Data Binding it works in runtime very well.
I am guaranteed that this solution is not the best but it's working in a simple way.
I hope it helps.