Change App language at RunTime on-the-fly

后端 未结 3 1545
鱼传尺愫
鱼传尺愫 2020-12-19 02:48

I\'m currently developing a metro app in which the user can change current language at runtime and all the custom controls that are loaded must update their text regarding t

3条回答
  •  伪装坚强ぢ
    2020-12-19 03:28

    In order to respond right away, you would need to reset the context of the resource manager.

    For Windows 8.1: var resourceContext = Windows.ApplicationModel.Resources.Core.ResourceContext.GetForCurrentView();

    resourceContext.Reset();

    You will still need to force your page to redraw itself and thus re-request the resources to get the changes to take place. For Windows 8, you can see https://timheuer.com/blog/archive/2013/03/26/howto-refresh-languages-winrt-xaml-windows-store.aspx

提交回复
热议问题