Ejemplo n.º 1
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     foreach (var currency in ExchangeRate.GetCurrencies())
     {
         _baseCurrencyCombobox.Items.Add(currency.ToString());
     }
 }
Ejemplo n.º 2
0
 private void _baseCurrencyCombobox_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     _subCurrencyCombobox.Visibility = Visibility.Visible;
     _subCurrencyCombobox.Items.Clear();
     foreach (var currency in ExchangeRate.GetCurrencies())
     {
         if (currency.ToString() != _baseCurrencyCombobox.SelectedItem.ToString())
         {
             _subCurrencyCombobox.Items.Add(currency);
         }
     }
     _subCurrencyCombobox1.Items.Clear();
     _confirmButton.Visibility = Visibility.Hidden;
 }
Ejemplo n.º 3
0
 private void _subCurrencyCombobox_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (_subCurrencyCombobox.Items.Count == 0)
     {
         return;
     }
     _subCurrencyCombobox1.Visibility = Visibility.Visible;
     _subCurrencyCombobox1.Items.Clear();
     foreach (var currency in ExchangeRate.GetCurrencies())
     {
         if (currency.ToString() != _subCurrencyCombobox.SelectedItem.ToString() && currency.ToString() != _baseCurrencyCombobox.SelectedItem.ToString())
         {
             _subCurrencyCombobox1.Items.Add(currency);
             //If only 1 sub currency can be chosen, then auto fill it
             if (_subCurrencyCombobox1.Items.Count == 1)
             {
                 _subCurrencyCombobox1.SelectedIndex = 0; _confirmButton.Visibility = Visibility.Visible;
             }
         }
     }
     ;
 }