private void UxPoolSelectorDdl_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (TxtAddress != null && TxtUsername != null && TxtPassword != null)
     {
         TxtPool.Text     = MiningOperations.GetAddressForPool((MiningOperations.MiningPools)uxPoolSelectorDdl.SelectedIndex);
         TxtUsername.Text = MiningOperations.GetUsernameForPool((MiningOperations.MiningPools)uxPoolSelectorDdl.SelectedIndex);
         TxtPassword.Text = MiningOperations.GetPasswordForPool((MiningOperations.MiningPools)uxPoolSelectorDdl.SelectedIndex);
     }
     SetStatsURL();
 }
        private void PopulatePage()
        {
            if (Debugger.IsAttached)
            {
                Settings.Default.P2PoolSettings        = null;
                Settings.Default.CustomSettings        = null;
                Settings.Default.MiningPoolHubSettings = null;
                Settings.Default.SuprNovaSettings      = null;
            }


            uxIntervalSlider.Value          = Settings.Default.MineIntensity;
            TxtAddress.Text                 = string.IsNullOrEmpty(Settings.Default.GrsWalletAddress) ? MiningOperations.GetAddress() : Settings.Default.GrsWalletAddress;
            uxPoolSelectorDdl.SelectedIndex = Settings.Default.SelectedMiningPool;
            TxtPool.Text                 = MiningOperations.GetAddressForPool((MiningOperations.MiningPools)uxPoolSelectorDdl.SelectedIndex);
            TxtUsername.Text             = Settings.Default.MiningPoolUsername;
            TxtPassword.Text             = Settings.Default.MiningPoolPassword;
            uxAutoIntensityChk.IsChecked = Settings.Default.UseAutoIntensity;
            UxIntensityTxt.Text          = Settings.Default.MineIntensity.ToString();
            UxCpuTgl.IsChecked           = Settings.Default.CPUMining;
            uxnVidiaRb.IsChecked         = (MiningOperations.GpuMiningSettings)Settings.Default.GPUMining == MiningOperations.GpuMiningSettings.NVidia;
            uxnAMDRb.IsChecked           = (MiningOperations.GpuMiningSettings)Settings.Default.GPUMining == MiningOperations.GpuMiningSettings.Amd;


            WpCustom3.Visibility = uxnAMDRb.IsChecked == true ? Visibility.Visible : Visibility.Collapsed;

            if (uxAutoIntensityChk.IsChecked == true)
            {
                UxIntensityTxt.Visibility   = Visibility.Collapsed;
                uxIntervalSlider.Visibility = Visibility.Collapsed;
            }
            else
            {
                UxIntensityTxt.Visibility   = Visibility.Visible;
                uxIntervalSlider.Visibility = Visibility.Visible;
            }

            if (Settings.Default.P2PoolSettings == null)
            {
                Settings.Default.P2PoolSettings = new StringCollection {
                    MiningOperations.GetAddressForPool(MiningOperations.MiningPools.P2Pool),
                    MiningOperations.GetUsernameForPool(MiningOperations.MiningPools.P2Pool),
                    MiningOperations.GetPasswordForPool(MiningOperations.MiningPools.P2Pool)
                };
            }
            if (Settings.Default.CustomSettings == null)
            {
                Settings.Default.CustomSettings = new StringCollection {
                    MiningOperations.GetAddressForPool(MiningOperations.MiningPools.Custom),
                    MiningOperations.GetUsernameForPool(MiningOperations.MiningPools.Custom),
                    MiningOperations.GetPasswordForPool(MiningOperations.MiningPools.Custom)
                };
            }
            if (Settings.Default.MiningPoolHubSettings == null)
            {
                Settings.Default.MiningPoolHubSettings = new StringCollection {
                    MiningOperations.GetAddressForPool(MiningOperations.MiningPools.MiningPoolHub),
                    MiningOperations.GetUsernameForPool(MiningOperations.MiningPools.MiningPoolHub),
                    MiningOperations.GetPasswordForPool(MiningOperations.MiningPools.MiningPoolHub)
                };
            }
            if (Settings.Default.SuprNovaSettings == null)
            {
                Settings.Default.SuprNovaSettings = new StringCollection {
                    MiningOperations.GetAddressForPool(MiningOperations.MiningPools.Suprnova),
                    MiningOperations.GetUsernameForPool(MiningOperations.MiningPools.Suprnova),
                    MiningOperations.GetPasswordForPool(MiningOperations.MiningPools.Suprnova)
                };
            }
            Settings.Default.Save();
        }