Exemplo n.º 1
0
        /// <summary>
        /// To Manually raise CurrentLanguageChanging and CurrentLanguageChanged events.
        /// Force events even if the current language didn't changed.
        /// </summary>
        public void RaiseLanguageChangeEvents()
        {
            var changingArgs = new CurrentLanguageChangingEventArgs(currentLanguage, currentLanguage);
            var changedArgs  = new CurrentLanguageChangedEventArgs(currentLanguage, currentLanguage);

            CurrentLanguageChanging?.Invoke(this, changingArgs);

            if (!changingArgs.Cancel)
            {
                CurrentLanguageChanged?.Invoke(this, changedArgs);
                NotifyPropertyChanged(nameof(CurrentLanguage));
            }
        }
Exemplo n.º 2
0
 private void Setting_CurrentLanguageChanged(object sender, LanguageChangedEventArgs e)
 => CurrentLanguageChanged?.Invoke(sender, e);