void HandleRadioBtnChange(SettingsLanguageSelection selection, UIButton sender)
        {
            if (SettingsGeneralViewModel.Selection == selection)
            {
                BokmalButton.Selected     = SettingsGeneralViewModel.Selection == SettingsLanguageSelection.Bokmal;
                NynorskButton.Selected    = SettingsGeneralViewModel.Selection == SettingsLanguageSelection.Nynorsk;
                EnglishButton.Selected    = SettingsGeneralViewModel.Selection == SettingsLanguageSelection.English;
                LithuanianButton.Selected = SettingsGeneralViewModel.Selection == SettingsLanguageSelection.Lithuanian;
                PolishButton.Selected     = SettingsGeneralViewModel.Selection == SettingsLanguageSelection.Polish;
                SomaliButton.Selected     = SettingsGeneralViewModel.Selection == SettingsLanguageSelection.Somali;
                TigrinyaButton.Selected   = SettingsGeneralViewModel.Selection == SettingsLanguageSelection.Tigrinya;
                ArabicButton.Selected     = SettingsGeneralViewModel.Selection == SettingsLanguageSelection.Arabic;
                UrduButton.Selected       = SettingsGeneralViewModel.Selection == SettingsLanguageSelection.Urdu;
                return;
            }

            DialogHelper.ShowDialog(this, SettingsGeneralViewModel.GetChangeLanguageViewModel,
                                    Action =>
            {
                _resetViews.ResetViews();
            }
                                    );

            LocalPreferencesHelper.SetAppLanguage(SettingsLanguageSelectionExtensions.ToString(selection));

            LayoutUtils.OnLayoutDirectionChange();

            LocalesService.SetInternationalization();
            SetupRadioButtons();
        }
Пример #2
0
        void HandleRadioBtnChange(SettingsLanguageSelection selection, UIButton sender)
        {
            if (SettingsGeneralViewModel.Selection == selection)
            {
                RadioButton1.Selected = SettingsGeneralViewModel.Selection == SettingsLanguageSelection.Bokmal;
                RadioButton2.Selected = SettingsGeneralViewModel.Selection == SettingsLanguageSelection.Nynorsk;
                RadioButton3.Selected = SettingsGeneralViewModel.Selection == SettingsLanguageSelection.English;
                return;
            }

            switch (selection)
            {
            case SettingsLanguageSelection.Bokmal:
                DialogHelper.ShowDialog(this, SettingsGeneralViewModel.GetChangeLanguageViewModel, (Action) => { });
                LocalPreferencesHelper.SetAppLanguage("nb");
                break;

            case SettingsLanguageSelection.Nynorsk:
                DialogHelper.ShowDialog(this, SettingsGeneralViewModel.GetChangeLanguageViewModel, (Action) => { });
                LocalPreferencesHelper.SetAppLanguage("nn");
                break;

            case SettingsLanguageSelection.English:
                DialogHelper.ShowDialog(this, SettingsGeneralViewModel.GetChangeLanguageViewModel, (Action) => { });
                LocalPreferencesHelper.SetAppLanguage("en");
                break;
            }

            LocalesService.SetInternationalization();
            SetupRadioButtons();
        }
            public async void OnCheckedChanged(RadioGroup group, int checkedId)
            {
                switch (checkedId)
                {
                case Resource.Id.settings_general_english:
                    await DialogUtils.DisplayDialogAsync(_self, GetChangeLanguageViewModel);

                    LocalPreferencesHelper.SetAppLanguage("en");
                    break;

                case Resource.Id.settings_general_bokmal:
                    await DialogUtils.DisplayDialogAsync(_self, GetChangeLanguageViewModel);

                    LocalPreferencesHelper.SetAppLanguage("nb");
                    break;

                case Resource.Id.settings_general_nynorsk:
                    await DialogUtils.DisplayDialogAsync(_self, GetChangeLanguageViewModel);

                    LocalPreferencesHelper.SetAppLanguage("nn");
                    break;
                }
                LocalesService.SetInternationalization();
                // TODO Client do not want reset feature for now. Left for future release.
                //_self._resetViews.ResetViews();
            }
        void HandleRadioBtnChange(SettingsLanguageSelection selection, UIButton sender)
        {
            if (SettingsGeneralViewModel.Selection == selection)
            {
                RadioButton1.Selected = SettingsGeneralViewModel.Selection == SettingsLanguageSelection.Bokmal;
                RadioButton2.Selected = SettingsGeneralViewModel.Selection == SettingsLanguageSelection.Nynorsk;
                RadioButton3.Selected = SettingsGeneralViewModel.Selection == SettingsLanguageSelection.English;
                return;
            }

            switch (selection)
            {
            case SettingsLanguageSelection.Bokmal:
                DialogHelper.ShowDialog(this, SettingsGeneralViewModel.GetChangeLanguageViewModel,
                                        Action =>
                {
                    // TODO Client do not want reset feature for now. Left for future release.
                    //_resetViews.ResetViews();
                });
                LocalPreferencesHelper.SetAppLanguage("nb");
                break;

            case SettingsLanguageSelection.Nynorsk:
                DialogHelper.ShowDialog(this, SettingsGeneralViewModel.GetChangeLanguageViewModel,
                                        Action =>
                {
                    // TODO Client do not want reset feature for now. Left for future release.
                    //_resetViews.ResetViews();
                });
                LocalPreferencesHelper.SetAppLanguage("nn");
                break;

            case SettingsLanguageSelection.English:
                DialogHelper.ShowDialog(this, SettingsGeneralViewModel.GetChangeLanguageViewModel,
                                        Action =>
                {
                    // TODO Client do not want reset feature for now. Left for future release.
                    //_resetViews.ResetViews();
                });
                LocalPreferencesHelper.SetAppLanguage("en");
                break;
            }

            LocalesService.SetInternationalization();
            SetupRadioButtons();
        }
Пример #5
0
            public async void OnCheckedChanged(RadioGroup group, int checkedId)
            {
                switch (checkedId)
                {
                case Resource.Id.settings_general_english:
                    await DialogUtils.DisplayDialogAsync(_self, GetChangeLanguageViewModel);

                    LocalPreferencesHelper.SetAppLanguage("en");
                    break;

                case Resource.Id.settings_general_bokmal:
                    await DialogUtils.DisplayDialogAsync(_self, GetChangeLanguageViewModel);

                    LocalPreferencesHelper.SetAppLanguage("nb");
                    break;

                case Resource.Id.settings_general_nynorsk:
                    await DialogUtils.DisplayDialogAsync(_self, GetChangeLanguageViewModel);

                    LocalPreferencesHelper.SetAppLanguage("nn");
                    break;
                }
                LocalesService.SetInternationalization();
            }
            public async void OnCheckedChanged(RadioGroup group, int checkedId)
            {
                switch (checkedId)
                {
                case Resource.Id.settings_general_english:
                    await DialogUtils.DisplayDialogAsync(_self, GetChangeLanguageViewModel);

                    LocalPreferencesHelper.SetAppLanguage("en");
                    break;

                case Resource.Id.settings_general_bokmal:
                    await DialogUtils.DisplayDialogAsync(_self, GetChangeLanguageViewModel);

                    LocalPreferencesHelper.SetAppLanguage("nb");
                    break;

                case Resource.Id.settings_general_nynorsk:
                    await DialogUtils.DisplayDialogAsync(_self, GetChangeLanguageViewModel);

                    LocalPreferencesHelper.SetAppLanguage("nn");
                    break;

                case Resource.Id.settings_general_polish:
                    await DialogUtils.DisplayDialogAsync(_self, GetChangeLanguageViewModel);

                    LocalPreferencesHelper.SetAppLanguage("pl");
                    break;

                case Resource.Id.settings_general_somali:
                    await DialogUtils.DisplayDialogAsync(_self, GetChangeLanguageViewModel);

                    LocalPreferencesHelper.SetAppLanguage("so");
                    break;

                case Resource.Id.settings_general_tigrinya:
                    await DialogUtils.DisplayDialogAsync(_self, GetChangeLanguageViewModel);

                    LocalPreferencesHelper.SetAppLanguage("ti");
                    break;

                case Resource.Id.settings_general_arabic:
                    await DialogUtils.DisplayDialogAsync(_self, GetChangeLanguageViewModel);

                    LocalPreferencesHelper.SetAppLanguage("ar");
                    break;

                case Resource.Id.settings_general_urdu:
                    await DialogUtils.DisplayDialogAsync(_self, GetChangeLanguageViewModel);

                    LocalPreferencesHelper.SetAppLanguage("ur");
                    break;

                case Resource.Id.settings_general_lithuanian:
                    await DialogUtils.DisplayDialogAsync(_self, GetChangeLanguageViewModel);

                    LocalPreferencesHelper.SetAppLanguage("lt");
                    break;
                }
                LocalesService.SetInternationalization();
                _self._resetViews.ResetViews();
            }