加载语言xaml文件
string xamlFilePath =AppDomain.CurrentDomain.BaseDirectory + "Language/Russian.xaml";
using (FileStream fs = new FileStream(xamlFilePath, FileMode.Open))
{
ResourceDictionary resourceDictionary = (ResourceDictionary)XamlReader.Load(fs);
Application.Current.Resources.MergedDictionaries.Add(resourceDictionary);
}
动态更换语言文件
string xamlFilePath =AppDomain.CurrentDomain.BaseDirectory + "Language/Russian.xaml";
Resources.MergedDictionaries[0].Source = new Uri(xamlFilePath);