public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) { var ac = values[0] as Acquirable[]; string currency = values[1] as string; if (ac != null && currency != null) { float sum = (from a in ac select StaticCurrencyConverter.Convert(a.Cost, a.Currency, currency)).Sum(); return(string.Format("{0:0.00} {1}", sum, currency)); } else { return(string.Empty); } }
private async void initRates() { StaticCurrencyConverter.Init(); rates = await new Fixer().GetRatesAsync(); notifyPropertyChanged("Rates"); }