private async void GetBalances_Click(object sender, RoutedEventArgs e)
        {
            btnGetBalance.IsEnabled = false;
            double total = WalletData.BitAddList.Count;

            progressBar.Value = 0;
            bool balChanged = false;

            for (int i = 0; i < WalletData.BitAddList.Count; i++)
            {
                decimal tempBal = WalletData.BitAddList[i].Balance;
                await WalletData.GetBalance(WalletData.BitAddList[i]);

                if (balChanged != true && WalletData.BitAddList[i].Balance != tempBal)
                {
                    balChanged = true;
                }
                progressBar.Value = ((i + 1) / total) * 100;
            }
            if (balChanged)
            {
                btnSave.IsEnabled    = true;
                headerSave.IsEnabled = true;
                lvAddresses.Items.Refresh();
                CalculateTotal();
            }
        }
Example #2
0
 private void btnSave_Click(object sender, RoutedEventArgs e)
 {
     WalletData.Settings.BitcoinPriceInUSD          = decimal.Parse(txtBitcoinPriceInUSD.Text);
     WalletData.Settings.DollarPriceInLocalCurrency = decimal.Parse(txtDollarPriceInLocalCurrency.Text);
     WalletData.Settings.LocalCurrencySymbol        = txtLocalCurrencySymbol.Text;
     WalletData.SaveSettings();
     this.Close();
 }
        public MainWindow()
        {
            InitializeComponent();

            WalletData.Load();
            lvAddresses.ItemsSource    = WalletData.BitAddList;
            lblLocalCurrStmbol.Content = WalletData.Settings.LocalCurrencySymbol;
            CalculateTotal();

            txtTotalB.Background = Brushes.White;
            btnSave.IsEnabled    = false;
            headerSave.IsEnabled = false;

            var ver = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;

            txtVersion.Text = string.Format("Version {0}.{1}.{2}", ver.Major, ver.Minor, ver.Build);
        }
 private void Save_Click(object sender, RoutedEventArgs e)
 {
     WalletData.Save();
     btnSave.IsEnabled    = false;
     headerSave.IsEnabled = false;
 }