改变语言并重新刷新界面
2016-06-10 13:26
330 查看
>>"for example i will change application language in settings.xaml so i want to restart appication or go to App.cs constructor again without exit ?"
If your app is Universal Windows Phone 8.1 runtime app, because the pages and controls that are already rendered are cached, we can use ResourceContext.Reset methods to update text of all custom controls at runtime without restarting the app. For example:
After that, reload your Page, using Navigate method:
If your app is Universal Windows Phone 8.1 runtime app, because the pages and controls that are already rendered are cached, we can use ResourceContext.Reset methods to update text of all custom controls at runtime without restarting the app. For example:
var NewLanguage = (string)((ComboBoxItem)e.AddedItems[0]).Tag; Windows.Globalization.ApplicationLanguages.PrimaryLanguageOverride = NewLanguage; Windows.ApplicationModel.Resources.Core.ResourceContext.GetForViewIndependentUse().Reset(); Windows.ApplicationModel.Resources.Core.ResourceContext.GetForCurrentView().Reset();
After that, reload your Page, using Navigate method:
if (Frame != null) Frame.Navigate(typeof(MyPage));
相关文章推荐
- 一个简单的epoll使用例子
- JavaScript中Event.returnValue属性
- eclipse/myeclipse 使用技巧
- 即时通信技术--IM系列之二
- 约瑟夫环的实现
- Hibernate与数据库事务
- java异常体系
- hdu3666 Count the string
- mysql MVCC之InnoDB实现
- 捕捉HTTP数据,解析Request header
- Sass安装
- java中作用域public,private,protected以及不写时的区别
- Clojure小教程(更新中)
- Spring配置声明式事务--注解方式
- JDK1.8新特性
- JavaScript 高级课程之缓冲+多个DIV运动框架实现 + 透明度
- Subsets
- java泛型
- DataStructure——红黑树学习笔记
- shell简单编程