mirror of
https://github.com/holgerb83/ModernWpfPlayground.git
synced 2025-06-30 09:40:52 +02:00
fixed
This commit is contained in:
@ -28,10 +28,10 @@ namespace ModernWpfPlayground.PropertyPresenter2
|
||||
{
|
||||
if (!(value is Enum enumValue)) return string.Empty;
|
||||
var descriptionAttribute = enumValue.GetType()
|
||||
.GetField(enumValue.ToString()).GetCustomAttributes(false)
|
||||
.GetField(enumValue.ToString())?.GetCustomAttributes(false)
|
||||
.OfType<DescriptionAttribute>().FirstOrDefault();
|
||||
|
||||
return descriptionAttribute?.Description ?? value.ToString();
|
||||
return descriptionAttribute?.Description ?? value.ToString() ?? string.Empty;
|
||||
}
|
||||
|
||||
object IValueConverter.ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
|
Reference in New Issue
Block a user