zoukankan      html  css  js  c++  java
  • Silverlight动态载入调用XAML资源

     

         以多语言为例子:

        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);

  • 相关阅读:
    liunx各命令及全称
    window启动数据库服务命令
    拉取github指定分支上的代码
    python项目学习
    客户展示 增删改查
    登录 注册功能 表梳理
    java简历
    go语言数组
    go语言 变量作用域
    go语言函数
  • 原文地址:https://www.cnblogs.com/yubinfeng/p/3698232.html
Copyright © 2011-2022 走看看