using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows.Data; namespace PipeGallery.Converter { public class DistanceConverter : IMultiValueConverter { public object Convert(object[] value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { if (value.Length == 3) { double d0 = (double)value[0]; double d1 = (double)value[1]; double d2 = (double)value[2]; double d3 = d2 * d0 / d1; int p = System.Convert.ToInt32(parameter); if (p==1) { d3 = d3 + 6; } else { d3 = d3 - 75; } return d3; } return null; } public object[] ConvertBack(object value, Type[] targetType, object parameter, System.Globalization.CultureInfo culture) { throw new NotImplementedException(); } } }