123456789101112131415161718192021222324252627282930313233 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Windows.Data;
- using DataAnalysisControl.Core;
- namespace Aitex.UI.Charting.Converter
- {
- public class ColorToBrushConverter : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
- {
- try
- {
- var color = (System.Windows.Media.Color)value;
- return new System.Windows.Media.SolidColorBrush(color);
- }
- catch (Exception ex)
- {
- CONTEXT.WriteLog(ex);
- }
- return System.Windows.Media.Brushes.Black;
- }
- public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
- {
- return null;
- }
- }
- }
|