private void ComboBoxTheme_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (!comboBoxTheme.IsLoaded)
            {
                return;
            }

            // Apply selected theme
            ThemeHelper.ApplySkin((Skin)comboBoxTheme.SelectedItem);
        }
 /// <summary>
 /// Cancels the changes already applied.
 /// </summary>
 public void CancelChanges()
 {
     // Revert the language only if it has been changed
     if ((Language)comboBoxLanguage.SelectedValue != App.UserSettings.Language)
     {
         LanguageHelper.ApplyLanguage(App.UserSettings.Language);
     }
     // Revert the theme only if it has been changed
     if ((Skin)comboBoxTheme.SelectedItem != App.UserSettings.Theme)
     {
         ThemeHelper.ApplySkin(App.UserSettings.Theme);
     }
 }
Exemplo n.º 3
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            InitializeLogger();

            // Manage unhandled exceptions
            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;

            // Define the default security protocol to use for connection as TLS (#109)
            ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;

            InitializeSettings();
            LanguageHelper.ApplyLanguage(UserSettings.Language);
            ThemeHelper.ApplySkin(UserSettings.Theme);
        }
 /// <summary>
 /// Cancels the changes already applied.
 /// </summary>
 public void CancelChanges()
 {
     LanguageHelper.ApplyLanguage(App.UserSettings.Language);
     ThemeHelper.ApplySkin(App.UserSettings.Theme);
 }