123456789101112131415161718192021222324252627282930313233343536373839404142 |
- 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 PDF_Master.DataConvert
- {
- class IntToColorBrush : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- SolidColorBrush brush = new SolidColorBrush(Colors.Black);
- switch ((int)value)
- {
- case 1:
- brush = new SolidColorBrush(Color.FromArgb(0xFF, 0x25, 0x26, 0x29));
- break;
- case 2:
- brush = new SolidColorBrush(Color.FromArgb(0xFF, 0xF3, 0x46, 0x5B));
- break;
- case 3:
- brush = new SolidColorBrush(Color.FromArgb(0xFF, 0x27, 0x3C, 0x62));
- break;
- case 4:
- brush = new SolidColorBrush(Color.FromArgb(0xFF, 0x94, 0x98, 0x9C));
- break;
- default:
- break;
- }
- return brush;
- }
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- {
- throw new NotImplementedException();
- }
- }
- }
|