コード例 #1
0
    private void ButtonSaveLang_OnClick(object sender, RoutedEventArgs e)
    {
        //Store the Messagebox result in result variable

        MessageBoxResult result = MessageBox.Show("App language will be changed. Do you want to continue?", "Apply Changes", MessageBoxButton.OKCancel);

        //check if user clicked on ok
        if (result == MessageBoxResult.OK)
        {
            var languageComboBox = ChangeLanguageCombo.SelectedItem;

            LocalizationManager.ChangeAppLanguage(languageComboBox.ToString());
            //Application.Current.Terminate(); I am commenting out because I don't neede to restart my app anymore.
        }
        else
        {
            SelectChoice();
        }
    }