converter fix

This commit is contained in:
2023-07-04 15:21:19 +09:00
parent de76ae38b4
commit 1a082fe79c
2 changed files with 5 additions and 5 deletions

View File

@@ -15,10 +15,10 @@ namespace BindingValidationRuleSample.Converter
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (targetType != typeof(Brush))
return null;
return Brushes.Black;
if (value == null)
return null;
return Brushes.Black;
int age = int.Parse(value.ToString());
return ValueColor(age);