35 lines
720 B
C#
35 lines
720 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Globalization;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Data;
|
|
using System.Windows.Media;
|
|
|
|
namespace BeWo.Converter
|
|
{
|
|
public class ValidationToBrushConverter : IValueConverter
|
|
{
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
if(value is null)
|
|
{
|
|
return Brushes.Black;
|
|
}
|
|
|
|
if(value is bool val_bool)
|
|
{
|
|
return val_bool ? Brushes.Black : Brushes.Red;
|
|
}
|
|
|
|
return Brushes.Blue;
|
|
}
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
}
|
|
}
|