A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
Language not refreshing on runtime
Puri, Sahil
20
Reputation points
I am trying to change the language from resx in setting page through Shell navigation. But it is not reflecting the changes at runtime in MAUI application. If i am relaunching the app it is working fine from the App.xaml.cs file. I want a solution to change it on runtime in the same launch without again launching the application. Below is the sample code i am using for that. Any guesses on why it is not happening or what is missing in this?
Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(a);
AppResources.Culture = Thread.CurrentThread.CurrentUICulture;
var vv = MauiProgram.ServiceProvider.GetService<Views.MyPage>(); App.Current.MainPage = new Services.NavigationService(vv);
Developer technologies | .NET | .NET Multi-platform App UI
Developer technologies | .NET | .NET Multi-platform App UI
Sign in to answer