I have a wpf xaml form which has 5 text boxes shows order price. Below the 5 text boxes i have another textbox:[subTotal] which displays the subtotal of order price\'s.\"Su
Using this converter:
public class SumConverter : IMultiValueConverter
{
public object Convert(object[] values, Type targetType,
object parameter, System.Globalization.CultureInfo culture)
{
double _Sum = 0;
if (values == null)
return _Sum;
foreach (var item in values)
{
double _Value;
if (double.TryParse(item.ToString(), out _Value))
_Sum += _Value;
}
return _Sum;
}
public object[] ConvertBack(object value, Type[] targetTypes,
object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
}
Do this:
Looks like:
