| 12345678910111213141516171819202122232425262728293031323334353637383940 | using System;using System.Windows.Data;using System.Windows.Media;using Aitex.Core.RT.Log;namespace FurnaceUI.Converter{    public class LineColorConverter : IValueConverter    {        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)        {            try            {                Color color = (Color)value;                return new SolidColorBrush(color);            }            catch (Exception ex)            {                LOG.Write(ex);            }            return Brushes.Black;        }        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)        {            try            {                Brush brush = (SolidColorBrush)value;                Color color = (Color)ColorConverter.ConvertFromString(brush.ToString());                return color;            }            catch (Exception ex)            {                LOG.Write(ex);            }            return Colors.Black;        }    }}
 |