给定Dictionary<string, string>,如何在不手动编辑文件的情况下创建语言资源的ResourceDictionary字典?框架内是否有任何内置工具可以序列化/反序列化ResourceDictionary?
字典示例:
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:v="clr-namespace:System;assembly=mscorlib">
<!-- Main window -->
<v:String x:Key="m_Title">Пример WPF локализации</v:String>
<v:String x:Key="m_lblHelloWorld">Привет мир!</v:String>
<v:String x:Key="m_menu_Language">Язык</v:String>
<v:Double x:Key="m_Number">10.5</v:Double>
</ResourceDictionary>
本地化示例取自此处。