public object Convert(object value, Type targetType, object parameter, string language) { object result; FrameworkElement frameworkElement = (FrameworkElement)parameter; EntityProperty entityProperty = (EntityProperty)frameworkElement.DataContext; if (entityProperty != null) { result = entityProperty.GetConvertValue(value); } else { result = value; } return(result); }