Ejemplo n.º 1
0
 private void UpdateCurrencyButtons()
 {
     if (ForeignCurrencyButtons.Count() == 1 && ForeignCurrencyButtons.First().Parameter.ExchangeRate == 1)
     {
         ForeignCurrency = ForeignCurrencyButtons.First().Parameter;
         ForeignCurrencyButtons.Clear();
     }
     foreach (var commandButtonViewModel in ForeignCurrencyButtons)
     {
         var pm = GetPaymentDueValue() / commandButtonViewModel.Parameter.ExchangeRate;
         commandButtonViewModel.Caption = string.Format(commandButtonViewModel.Parameter.CurrencySymbol, pm);
     }
 }
        private void RefreshForeignCurrencyButtons()
        {
            ForeignCurrencyButtons.Clear();

            if (_cacheService.GetForeignCurrencies().Count() == 1 &&
                _cacheService.GetForeignCurrencies().First().ExchangeRate == 1)
            {
                ForeignCurrency = _cacheService.GetForeignCurrencies().First();
            }
            else
            {
                ForeignCurrencyButtons.AddRange(
                    _cacheService.GetForeignCurrencies()
                    .Select(
                        x =>
                        new CommandButtonViewModel <ForeignCurrency>
                {
                    Caption   = x.CurrencySymbol,
                    Command   = _foreignCurrencySelectedCommand,
                    Parameter = x
                }));
            }
        }