1using CommunityToolkit.Mvvm.Input;
4using System.Globalization;
9 public override double ViewWidthRequest => (DeviceDisplay.MainDisplayInfo.Width / DeviceDisplay.MainDisplayInfo.Density) * (3.0 / 4.0);
14 this.InitializeComponent();
16 this.BindingContext =
this;
22 public void SelectLanguage(
object Option)
24 if (Option is not
string Name)
29 foreach (
object Item
in this.LanguagesContainer)
31 if ((Item is VisualElement Element) &&
36 VisualStateManager.GoToState(Element, VisualStateManager.CommonStates.Selected);
39 Task ExecutionTask = this.Dispatcher.DispatchAsync(() => this.InnerScrollView.ScrollToAsync(Element, ScrollToPosition.MakeVisible,
true));
42 VisualStateManager.GoToState(Element, VisualStateManager.CommonStates.Normal);
46 if ((SelectedLanguage is not
null) && (Name != CultureInfo.CurrentCulture.Name))
48 Preferences.Set(
"user_selected_language", SelectedLanguage.TwoLetterISOLanguageName);
49 LocalizationManager.Current.CurrentCulture = SelectedLanguage;
The Application class, representing an instance of the Neuro-Access app.
static LanguageInfo SelectedLanguage
Selected language.
static readonly LanguageInfo[] SupportedLanguages
Supported languages.
Base class that references services in the app.
static IUiService UiService
Service serializing and managing UI-related tasks.