public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value is ElementHeight) { var heightValue = (ElementHeight)value; return(ElementDimension.MaximumNumberOfShelfs(heightValue)); } return(0); }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value is ElementHeight) { var height = (ElementHeight)value; var zoomFactor = 1.0; if (parameter != null) { Double.TryParse(parameter.ToString(), out zoomFactor); } return(ElementDimension.HeightInCm(height) * zoomFactor); } return(0.0); }