以多语言为例子:

    ResourceDictionary resourceDictionary = new ResourceDictionary(); //新建资源集合

            var culture = CultureInfo.CurrentCulture;//获取本地Culture

            if (culture.Name != "zh-CN")

            {

                Application.LoadComponent(resourceDictionary, new Uri("/ETiger_MarketTrack;component/Language/Chinese.xaml", UriKind.Relative));

            }

            else

            {

                Application.LoadComponent(resourceDictionary, new Uri("/ETiger_MarketTrack;component/Language/English.xaml", UriKind.Relative));

            }

    //将资源集合添加到AppResource中,注意这些代码必须在使用这些资源的控件初始化之前

            Application.Current.Resources.MergedDictionaries.Add(resourceDictionary);

相关文章:

  • 2021-09-26
  • 2022-12-23
  • 2022-12-23
  • 2021-07-03
  • 2022-01-17
  • 2021-07-16
猜你喜欢
  • 2021-10-04
  • 2022-12-23
  • 2022-12-23
  • 2021-05-16
相关资源
相似解决方案