void SteamVRChanged(bool active)
        {
            if (active)
            {
                Log("SteamVR detected!");

                //Rescan audio devices
                if (Properties.Settings.Default.rescanOnStart)
                {
                    Devcon.RescanHardware();
                }

                //Launch custom programs
                StringCollection launch = Properties.Settings.Default.customLaunchPrograms;

                if (launch != null && launch.Count > 0)
                {
                    foreach (string item in launch)
                    {
                        Process.Start(item);
                    }
                }


                //Set volumes
                if (Properties.Settings.Default.overrideAudioVol)
                {
                    AudioManager.SetVolumeOfDefault(Properties.Settings.Default.volEnterVR);
                }
            }
            else
            {
                Log("SteamVR closed... :(");

                //Reapply dashboard fix to keep it at high quality.
                if (Properties.Settings.Default.useDashboardFix)
                {
                    SVRSettings.ApplyDashboardFix(true);
                }


                //Set volumes
                if (Properties.Settings.Default.overrideAudioVol)
                {
                    AudioManager.SetVolumeOfDefault(Properties.Settings.Default.volExitVR);
                }
            }
        }
        private void UIDashboardQualityFix_Click(object sender, RoutedEventArgs e)
        {
            if (!uiEnabled)
            {
                return;
            }
            Properties.Settings.Default.useDashboardFix = (bool)UIDashboardQualityFix.IsChecked;
            Properties.Settings.Default.Save();

            try {
                SVRSettings.ApplyDashboardFix(Properties.Settings.Default.useDashboardFix);
                Log("Dashboard fix " + Properties.Settings.Default.useDashboardFix.ToString());
            } catch {
                Log("Error applying dashboard fix.");
            }
        }
        public MainWindow()
        {
            System.Windows.Forms.NotifyIcon ni = new System.Windows.Forms.NotifyIcon();
            ni.Icon         = new System.Drawing.Icon("Main.ico");
            ni.Visible      = true;
            ni.DoubleClick +=
                delegate(object sender, EventArgs args) {
                this.Show();
                this.WindowState = WindowState.Normal;
            };

            AudioManager.GetAudioOutputDevices();

            InitializeComponent();


            if (Properties.Settings.Default.startMinimized)
            {
                this.WindowState = WindowState.Minimized;
            }



            CheckSteamVR.steamVRChanged += SteamVRChanged;

            LoadUIValues();

            Log("Waiting for SteamVR...");

            CheckSteamVR.MonitorSteamVR();



            AutoUpdater.Start("https://raw.githubusercontent.com/CircuitLord/SteamVRManager/master/version.xml");


            if (Properties.Settings.Default.launchWithWindows)
            {
                HandleStartup.EnableRunAtStartup();
            }

            if (Properties.Settings.Default.useDashboardFix)
            {
                SVRSettings.ApplyDashboardFix(true);
            }
        }