2015-06-04 18:15:54 +01:00
|
|
|
|
using System;
|
|
|
|
|
using System.Windows.Data;
|
|
|
|
|
using System.Windows.Media;
|
|
|
|
|
|
2015-07-06 13:41:46 +01:00
|
|
|
|
namespace Filtration.Common.Converters
|
2015-06-04 18:15:54 +01:00
|
|
|
|
{
|
|
|
|
|
public class ColorToSolidColorBrushConverter : IValueConverter
|
|
|
|
|
{
|
|
|
|
|
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
|
|
|
|
{
|
|
|
|
|
return value != null ? new SolidColorBrush((Color)value) : null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
|
|
|
|
{
|
|
|
|
|
if (value != null)
|
|
|
|
|
return ((SolidColorBrush)value).Color;
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|