markus / KCOM / Common / Converter / PreviewerVisibleConverter.cs @ c5519c44
이력 | 보기 | 이력해설 | 다운로드 (1.14 KB)
1 | 787a4489 | KangIngu | using System; |
---|---|---|---|
2 | using System.Collections.Generic; |
||
3 | using System.Globalization; |
||
4 | using System.Linq; |
||
5 | using System.Text; |
||
6 | using System.Windows; |
||
7 | using System.Windows.Data; |
||
8 | |||
9 | namespace KCOM.Common.Converter |
||
10 | { |
||
11 | public class PreviewerVisibleConverter : IValueConverter |
||
12 | { |
||
13 | public object Convert(object value, Type targetType, object parameter, CultureInfo culture) |
||
14 | { |
||
15 | if (value != null) |
||
16 | { |
||
17 | if (value is bool) |
||
18 | { |
||
19 | if (!(bool)value) |
||
20 | return Visibility.Visible; |
||
21 | else |
||
22 | return Visibility.Collapsed; |
||
23 | } |
||
24 | else |
||
25 | { |
||
26 | throw new NotSupportedException("ConsolidationStringConverter bool만 가능합니다."); |
||
27 | } |
||
28 | } |
||
29 | else |
||
30 | { |
||
31 | throw new NotSupportedException("ConsolidationStringConverter ERROR"); |
||
32 | } |
||
33 | } |
||
34 | |||
35 | public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) |
||
36 | { |
||
37 | throw new NotImplementedException(); |
||
38 | } |
||
39 | } |
||
40 | } |