markus / KCOM / Common / Converter / ConsolidationBackgroudConverter.cs @ ac4f1e13
이력 | 보기 | 이력해설 | 다운로드 (1.59 KB)
1 | 787a4489 | KangIngu | using System; |
---|---|---|---|
2 | using System.Net; |
||
3 | using System.Windows; |
||
4 | using System.Windows.Controls; |
||
5 | using System.Windows.Documents; |
||
6 | using System.Windows.Ink; |
||
7 | using System.Windows.Input; |
||
8 | using System.Windows.Media; |
||
9 | using System.Windows.Media.Animation; |
||
10 | using System.Windows.Shapes; |
||
11 | using System.Windows.Data; |
||
12 | using System.Globalization; |
||
13 | |||
14 | |||
15 | namespace KCOM.Common.Converter |
||
16 | { |
||
17 | public class ConsolidationBackgroudConverter : IValueConverter |
||
18 | { |
||
19 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) |
||
20 | { |
||
21 | if (value != null) |
||
22 | { |
||
23 | if (value is Int32) |
||
24 | { |
||
25 | return new SolidColorBrush(Colors.Transparent); |
||
26 | } |
||
27 | else if (value is bool) |
||
28 | { |
||
29 | if ((bool)value) |
||
30 | //return new SolidColorBrush(StringToColorConverter.Parse("#ff74bdfd")); |
||
31 | return new SolidColorBrush { Color = Colors.Yellow, Opacity = 0.4 }; |
||
32 | else |
||
33 | return new SolidColorBrush(Colors.Transparent); |
||
34 | } |
||
35 | else |
||
36 | { |
||
37 | throw new NotSupportedException("ConsolidationStringConverter bool만 가능합니다."); |
||
38 | } |
||
39 | |||
40 | } |
||
41 | else |
||
42 | { |
||
43 | throw new NotSupportedException("ConsolidationStringConverter ERROR"); |
||
44 | } |
||
45 | } |
||
46 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) |
||
47 | { |
||
48 | throw new NotSupportedException(); |
||
49 | } |
||
50 | } |
||
51 | } |