Files
DP44/Common/DTS.Common/.svn/pristine/bd/bdf75858c36e6b327b93d7448bb84424e27c5b14.svn-base
2026-04-17 14:55:32 -04:00

30 lines
1.0 KiB
Plaintext

using System;
using System.Windows.Data;
using System.Windows.Media;
namespace DTS.Common.Converters
{
public class ErrorToColorConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
// For a more sophisticated converter, check also the targetType and react accordingly..
if (value is string)
{
return String.IsNullOrEmpty(value.ToString()) ? new SolidColorBrush(Colors.Black) : new SolidColorBrush(Colors.Red);
}
return new SolidColorBrush(Colors.Black);
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
// If necessary, here you can convert back. Check if which brush it is (if its one),
// get its Color-value and return it.
throw new NotImplementedException();
}
}
}