private void UpdateOptions()
 {
     foreach (OptionsDialogTab tab in tabbedPanel.Items)
     {
         tab.CommitConfig();
     }
     ConfigManager.LoadedConfig = QTUtility2.DeepClone(WorkingConfig);
     ConfigManager.WriteConfig();
     ConfigManager.UpdateConfig();
 }
 private void buildinCbx_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (true != radUseLangFileYes.IsChecked)
     {
         WorkingConfig.lang.BuiltInLangSelectedIndex = buildinCbx.SelectedIndex;
         ConfigManager.LoadedConfig = QTUtility2.DeepClone(WorkingConfig);
         ConfigManager.WriteConfig();
         ConfigManager.UpdateConfig();
         //QTUtility.ValidateTextResources
     }
 }
        private OptionsDialog()
        {
            Initialized     += (sender, args) => Topmost = true;
            ContentRendered += (sender, args) => Topmost = false;
            InitializeComponent();

            int i = 0;

            tabbedPanel.ItemsSource = new OptionsDialogTab[] {
                new Options01_Window        {
                    Index = i++
                },
                new Options02_Tabs          {
                    Index = i++
                },
                new Options03_Tweaks        {
                    Index = i++
                },
                new Options04_Tooltips      {
                    Index = i++
                },
                new Options05_General       {
                    Index = i++
                },
                new Options06_Appearance    {
                    Index = i++
                },
                new Options07_Mouse         {
                    Index = i++
                },
                new Options08_Keys          {
                    Index = i++
                },
                new Options09_Groups        {
                    Index = i++
                },
                new Options10_Apps          {
                    Index = i++
                },
                new Options11_ButtonBar     {
                    Index = i++
                },
                new Options12_Plugins       {
                    Index = i++
                },
                new Options13_Language      {
                    Index = i++
                },
                new Options14_About         {
                    Index = i
                }
            };

            // For some reason, on XP, the Options dialog starts up with a blank tab
            // This is the only way I've found to fix it
            // TODO: Investigate and see if there's a better way
            Loaded += (sender, args) => {
                tabbedPanel.SelectedIndex = 1;
                tabbedPanel.SelectedIndex = 0;
            };

            WorkingConfig = QTUtility2.DeepClone(ConfigManager.LoadedConfig);
            foreach (OptionsDialogTab tab in tabbedPanel.Items)
            {
                tab.WorkingConfig = WorkingConfig;
                IHotkeyContainer ihc = tab as IHotkeyContainer;
                if (ihc != null)
                {
                    ihc.NewHotkeyRequested += ProcessNewHotkey;
                }
                tab.InitializeConfig();
            }
        }